Skip to content

Add lightweight tool to list changed files in a pull request #958

@lgpearson1771

Description

@lgpearson1771

Summary

Add a simple, focused tool to list the files changed in a pull request — returning only file paths and change types (add, edit, delete, rename). This is intentionally lightweight: no diffs, no file content, just metadata.

This fills a gap between mcp_ado_repo_get_pull_request_by_id (which returns PR metadata but not changed files) and the heavier diff-oriented approach in #868 / PR #801 (which fetches full diffs and file content).

Use Cases

  • Scoping PR reviews: Agents can quickly see which files changed before deciding what to analyze in depth
  • Routing and triage: Determine affected areas (e.g., "does this PR touch tests? docs? config?") without fetching diffs
  • Composability: Pair with existing tools like repo_search_commits or repo_list_pull_request_threads for richer workflows without overwhelming the context window

Current workarounds are insufficient

Existing tools like get_build_changes, search_commits, and list_pull_request_threads can approximate a file list, but none provide a clean "list of files changed in this PR" the way the ADO UI does. The dedicated API endpoint (/pullRequests/{id}/iterations/{id}/changes) exists but isn't exposed as a tool.

Prior Discussion

Tools

Develop the following tool with full parameter support, including optional ones:

repo_get_pull_request_changed_files: Get files changed in a pull request

Returns file paths and change types only (no diff content).

Endpoint: GET https://dev.azure.com/{organization}/{project}/_apis/git/repositories/{repositoryId}/pullRequests/{pullRequestId}/iterations/{iterationId}/changes?api-version=7.1

Parameters:

  • repositoryId (required): The ID of the repository
  • pullRequestId (required): The ID of the pull request
  • project (optional): Project ID or project name
  • iterationId (optional): Iteration ID to get changes for. If not specified, fetches the latest iteration automatically
  • top (optional): Maximum number of changes to return
  • skip (optional): Number of changes to skip for pagination
  • compareTo (optional): Iteration ID to compare against

The tool should internally resolve the latest iteration (via GET .../pullRequests/{id}/iterations) when iterationId is not provided and return only the file-level metadata (path, original path, change type) from the response — stripping diff blocks and file content.

Metadata

Metadata

Labels

Needs Review 👓needs review by the product teamWaiting for Author 🔨waiting for author to address feedback or create a pull request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions