git_get_pull_request
Retrieve specific pull request details by ID from Azure DevOps organizations to monitor changes, review status, and track development progress across projects.
Instructions
Gets details of a specific pull request by ID
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| organization | Yes | The name of the Azure DevOps organization | |
| project | Yes | Project ID or name | |
| pullRequestId | Yes | The ID of the pull request |
Implementation Reference
- src/tools/repositories.ts:101-109 (handler)The handler function that executes the tool logic: retrieves the specific pull request details from Azure DevOps Git API using the provided organization, project, and pullRequestId, then returns the details as a JSON-formatted text response.async ({ organization, project, pullRequestId }) => { const connection = await connectionManager.getConnection(organization); const gitApi = await connection.getGitApi(); const pr = await gitApi.getPullRequestById(pullRequestId, project); return { content: [{ type: "text", text: JSON.stringify(pr, null, 2) }], }; }
- src/tools/repositories.ts:96-100 (schema)The Zod input schema defining parameters: organization (string), project (string), pullRequestId (number). No explicit output schema; returns standardized MCP content.{ organization: z.string().describe("The name of the Azure DevOps organization"), project: z.string().describe("Project ID or name"), pullRequestId: z.number().describe("The ID of the pull request"), },
- src/tools/repositories.ts:93-110 (registration)The server.tool call that registers the 'git_get_pull_request' tool with the MCP server, including name, description, input schema, and handler function.server.tool( "git_get_pull_request", "Gets details of a specific pull request by ID", { organization: z.string().describe("The name of the Azure DevOps organization"), project: z.string().describe("Project ID or name"), pullRequestId: z.number().describe("The ID of the pull request"), }, async ({ organization, project, pullRequestId }) => { const connection = await connectionManager.getConnection(organization); const gitApi = await connection.getGitApi(); const pr = await gitApi.getPullRequestById(pullRequestId, project); return { content: [{ type: "text", text: JSON.stringify(pr, null, 2) }], }; } );