Skip to main content
Glama
ennuiii

Azure DevOps MCP Server with PAT Authentication

by ennuiii

repo_get_pull_request_by_id

Retrieve a specific pull request by its ID from an Azure DevOps repository. Optionally include associated work item references for detailed tracking and management.

Instructions

Get a pull request by its ID.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
includeWorkItemRefsNoWhether to reference work items associated with the pull request.
pullRequestIdYesThe ID of the pull request to retrieve.
repositoryIdYesThe ID of the repository where the pull request is located.

Implementation Reference

  • The handler function retrieves the specified pull request using the Azure DevOps Git API's getPullRequest method and returns its details as a JSON-formatted text response.
    async ({ repositoryId, pullRequestId, includeWorkItemRefs }) => {
      const connection = await connectionProvider();
      const gitApi = await connection.getGitApi();
      const pullRequest = await gitApi.getPullRequest(repositoryId, pullRequestId, undefined, undefined, undefined, undefined, undefined, includeWorkItemRefs);
      return {
        content: [{ type: "text", text: JSON.stringify(pullRequest, null, 2) }],
      };
    }
  • Zod schema defining the input parameters for the tool: repositoryId (string), pullRequestId (number), and optional includeWorkItemRefs (boolean).
    {
      repositoryId: z.string().describe("The ID of the repository where the pull request is located."),
      pullRequestId: z.number().describe("The ID of the pull request to retrieve."),
      includeWorkItemRefs: z.boolean().optional().default(false).describe("Whether to reference work items associated with the pull request."),
    },
  • Registration of the tool using McpServer.tool(), associating the name REPO_TOOLS.get_pull_request_by_id ("repo_get_pull_request_by_id") with its description, input schema, and handler function.
    server.tool(
      REPO_TOOLS.get_pull_request_by_id,
      "Get a pull request by its ID.",
      {
        repositoryId: z.string().describe("The ID of the repository where the pull request is located."),
        pullRequestId: z.number().describe("The ID of the pull request to retrieve."),
        includeWorkItemRefs: z.boolean().optional().default(false).describe("Whether to reference work items associated with the pull request."),
      },
      async ({ repositoryId, pullRequestId, includeWorkItemRefs }) => {
        const connection = await connectionProvider();
        const gitApi = await connection.getGitApi();
        const pullRequest = await gitApi.getPullRequest(repositoryId, pullRequestId, undefined, undefined, undefined, undefined, undefined, includeWorkItemRefs);
        return {
          content: [{ type: "text", text: JSON.stringify(pullRequest, null, 2) }],
        };
      }
    );
  • Mapping in REPO_TOOLS constant that associates the internal identifier 'get_pull_request_by_id' with the tool name 'repo_get_pull_request_by_id'.
    get_pull_request_by_id: "repo_get_pull_request_by_id",
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states it's a read operation ('Get'), which implies non-destructive, but doesn't cover important aspects like authentication requirements, rate limits, error conditions, or what the response includes (e.g., fields returned, format). For a tool with no annotation coverage, this leaves significant 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, direct sentence with zero wasted words. It's appropriately sized for a simple retrieval tool and front-loads the core purpose immediately.

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

Completeness3/5

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

Given the tool's low complexity (simple read operation), high schema coverage (100%), and lack of output schema, the description is minimally adequate. However, it doesn't compensate for the absence of annotations or output schema by explaining behavioral traits or return values, leaving room for improvement in completeness.

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?

Schema description coverage is 100%, with clear descriptions for all parameters (pullRequestId, repositoryId, includeWorkItemRefs). The description adds no additional parameter semantics beyond what the schema already provides, so it meets the baseline of 3 where 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 ('Get') and resource ('a pull request by its ID'), making the purpose immediately understandable. It distinguishes from siblings like repo_list_pull_requests_by_repo (which lists multiple) by specifying retrieval by ID, though it doesn't explicitly mention this distinction in the description text.

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. It doesn't mention prerequisites (e.g., needing repositoryId and pullRequestId), compare to similar tools (e.g., repo_get_pull_request_by_id vs repo_list_pull_requests_by_repo for single vs multiple), or indicate any constraints.

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