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",
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden for behavioral disclosure. While it implies a mutation operation ('Add or remove'), it doesn't specify required permissions, whether changes are reversible, potential rate limits, or what happens if reviewer IDs are invalid. For a mutation tool with zero annotation coverage, this leaves significant behavioral gaps.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that gets straight to the point with zero wasted words. It's appropriately sized for the tool's complexity and front-loads the core functionality immediately.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a mutation tool with no annotations and no output schema, the description is insufficiently complete. It doesn't address what happens on success/failure, return values, error conditions, or integration with sibling tools. The combination of mutation nature and lack of structured metadata requires more descriptive context than provided.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema description coverage is 100%, with all parameters well-documented in the schema itself. The description doesn't add any meaningful parameter semantics beyond what's already in the schema (e.g., it doesn't explain format of reviewer IDs or provide examples). Baseline 3 is appropriate when the schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Add or remove') and resource ('reviewers for an existing pull request'), making the purpose immediately understandable. However, it doesn't explicitly differentiate from sibling tools like 'repo_update_pull_request' or mention that this is specifically for reviewer management rather than general pull request updates.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives like 'repo_update_pull_request' for other modifications, nor does it mention prerequisites such as needing an existing pull request ID or appropriate permissions. It simply states what the tool does without contextual usage instructions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

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