Skip to main content
Glama
ennuiii

Azure DevOps MCP Server with PAT Authentication

by ennuiii

repo_update_pull_request_reviewers

Add or remove reviewers from an Azure DevOps pull request by specifying repository ID, pull request ID, and reviewer IDs. Manage PR reviewers efficiently with this Azure DevOps MCP Server tool.

Instructions

Add or remove reviewers for an existing pull request.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
actionYesAction to perform on the reviewers. Can be 'add' or 'remove'.
pullRequestIdYesThe ID of the pull request to update.
repositoryIdYesThe ID of the repository where the pull request exists.
reviewerIdsYesList of reviewer ids to add or remove from the pull request.

Implementation Reference

  • The core handler function that implements the tool logic: connects to Azure DevOps Git API, adds reviewers if action='add' using createPullRequestReviewers, or removes them individually if 'remove' using deletePullRequestReviewer, and returns JSON response or confirmation.
    async ({ repositoryId, pullRequestId, reviewerIds, action }) => { const connection = await connectionProvider(); const gitApi = await connection.getGitApi(); let updatedPullRequest; if (action === "add") { updatedPullRequest = await gitApi.createPullRequestReviewers( reviewerIds.map((id) => ({ id: id })), repositoryId, pullRequestId ); return { content: [{ type: "text", text: JSON.stringify(updatedPullRequest, null, 2) }], }; } else { for (const reviewerId of reviewerIds) { await gitApi.deletePullRequestReviewer(repositoryId, pullRequestId, reviewerId); } return { content: [{ type: "text", text: `Reviewers with IDs ${reviewerIds.join(", ")} removed from pull request ${pullRequestId}.` }], }; } }
  • Input schema using Zod validation for the tool parameters: repositoryId (string), pullRequestId (number), reviewerIds (array of strings), action (enum: add/remove).
    { repositoryId: z.string().describe("The ID of the repository where the pull request exists."), pullRequestId: z.number().describe("The ID of the pull request to update."), reviewerIds: z.array(z.string()).describe("List of reviewer ids to add or remove from the pull request."), action: z.enum(["add", "remove"]).describe("Action to perform on the reviewers. Can be 'add' or 'remove'."), },
  • Registers the 'repo_update_pull_request_reviewers' tool on the McpServer using the name from REPO_TOOLS constant, with description, input schema, and handler function.
    server.tool( REPO_TOOLS.update_pull_request_reviewers, "Add or remove reviewers for an existing pull request.", { repositoryId: z.string().describe("The ID of the repository where the pull request exists."), pullRequestId: z.number().describe("The ID of the pull request to update."), reviewerIds: z.array(z.string()).describe("List of reviewer ids to add or remove from the pull request."), action: z.enum(["add", "remove"]).describe("Action to perform on the reviewers. Can be 'add' or 'remove'."), }, async ({ repositoryId, pullRequestId, reviewerIds, action }) => { const connection = await connectionProvider(); const gitApi = await connection.getGitApi(); let updatedPullRequest; if (action === "add") { updatedPullRequest = await gitApi.createPullRequestReviewers( reviewerIds.map((id) => ({ id: id })), repositoryId, pullRequestId ); return { content: [{ type: "text", text: JSON.stringify(updatedPullRequest, null, 2) }], }; } else { for (const reviewerId of reviewerIds) { await gitApi.deletePullRequestReviewer(repositoryId, pullRequestId, reviewerId); } return { content: [{ type: "text", text: `Reviewers with IDs ${reviewerIds.join(", ")} removed from pull request ${pullRequestId}.` }], }; } } );
  • Part of REPO_TOOLS constant that maps the internal identifier to the tool name string used in server.tool registration.
    update_pull_request_reviewers: "repo_update_pull_request_reviewers",

Other Tools

Related Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/ennuiii/DevOpsMcpPAT'

If you have feedback or need assistance with the MCP directory API, please join our Discord server