Skip to main content
Glama
Tiberriver256

Azure DevOps MCP Server

get_pull_request_checks

Retrieve status checks and policy evaluations for Azure DevOps pull requests to identify blocking validations and pipeline issues.

Instructions

Summarize the latest status checks and policy evaluations for a pull request.

  • Surfaces pipeline and run identifiers so you can jump straight to the blocking validation.

  • Pair with pipeline tools (e.g., get_pipeline_run, pipeline_timeline) to inspect failures in depth.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
projectIdNoThe ID or name of the project (Default: MyProject)
organizationIdNoThe ID or name of the organization (Default: mycompany)
repositoryIdYesThe ID or name of the repository
pullRequestIdYesThe ID of the pull request

Implementation Reference

  • Main handler function that fetches pull request statuses and policy evaluations from Azure DevOps APIs, maps them to the response format, and handles errors.
    export async function getPullRequestChecks(
      connection: WebApi,
      options: PullRequestChecksOptions,
    ): Promise<PullRequestChecksResult> {
      try {
        const [gitApi, policyApi, projectId] = await Promise.all([
          connection.getGitApi(),
          connection.getPolicyApi(),
          resolveProjectId(connection, options.projectId),
        ]);
    
        const [statusRecords, evaluationRecords] = await Promise.all([
          gitApi.getPullRequestStatuses(
            options.repositoryId,
            options.pullRequestId,
            projectId,
          ),
          policyApi.getPolicyEvaluations(
            projectId,
            buildPolicyArtifactId(projectId, options.pullRequestId),
          ),
        ]);
    
        return {
          statuses: (statusRecords ?? []).map(mapStatusRecord),
          policyEvaluations: (evaluationRecords ?? []).map(mapEvaluationRecord),
        };
      } catch (error) {
        if (error instanceof AzureDevOpsError) {
          throw error;
        }
        throw new Error(
          `Failed to get pull request checks: ${
            error instanceof Error ? error.message : String(error)
          }`,
        );
      }
    }
  • Zod input schema for validating tool arguments: projectId, organizationId, repositoryId, pullRequestId.
    export const GetPullRequestChecksSchema = z.object({
      projectId: z
        .string()
        .optional()
        .describe(`The ID or name of the project (Default: ${defaultProject})`),
      organizationId: z
        .string()
        .optional()
        .describe(`The ID or name of the organization (Default: ${defaultOrg})`),
      repositoryId: z.string().describe('The ID or name of the repository'),
      pullRequestId: z.number().describe('The ID of the pull request'),
    });
  • MCP tool registration defining the tool name, description, and JSON schema for inputs.
    {
      name: 'get_pull_request_checks',
      description: [
        'Summarize the latest status checks and policy evaluations for a pull request.',
        '- Surfaces pipeline and run identifiers so you can jump straight to the blocking validation.',
        '- Pair with pipeline tools (e.g., get_pipeline_run, pipeline_timeline) to inspect failures in depth.',
      ].join('\n'),
      inputSchema: zodToJsonSchema(GetPullRequestChecksSchema),
    },
  • Request handler router that parses arguments with schema and dispatches to the getPullRequestChecks handler.
    case 'get_pull_request_checks': {
      const params = GetPullRequestChecksSchema.parse(request.params.arguments);
      const result = await getPullRequestChecks(connection, {
        projectId: params.projectId ?? defaultProject,
        repositoryId: params.repositoryId,
        pullRequestId: params.pullRequestId,
      });
      return {
        content: [{ type: 'text', text: JSON.stringify(result, null, 2) }],
      };
    }
  • Helper function to resolve project ID or name to GUID using Core API.
    const resolveProjectId = async (
      connection: WebApi,
      projectIdOrName: string,
    ): Promise<string> => {
      if (projectIdGuidPattern.test(projectIdOrName)) {
        return projectIdOrName;
      }
    
      const coreApi = await connection.getCoreApi();
      const project = await coreApi.getProject(projectIdOrName);
    
      if (!project?.id) {
        throw new AzureDevOpsResourceNotFoundError(
          `Project '${projectIdOrName}' not found`,
        );
      }
    
      return project.id;
    };
Behavior4/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 effectively describes what the tool does (summarizes checks, surfaces pipeline/run IDs) and hints at its read-only nature by focusing on summarization and pairing with inspection tools. However, it doesn't explicitly mention permissions, rate limits, or error handling.

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 efficiently structured with a clear main sentence followed by two bullet points that add valuable context. Every sentence earns its place by explaining purpose, output utility, and integration with other tools without redundancy.

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

Completeness4/5

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

For a read operation with no annotations and no output schema, the description provides good context about what information is returned (status checks, policy evaluations, pipeline/run IDs) and how to use it with other tools. It could be more complete by explicitly stating it's a read-only operation or describing the output format, but it's largely adequate given the tool's complexity.

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%, so all parameters are documented in the schema. The description doesn't add any parameter-specific information beyond what's in the schema (e.g., it doesn't explain how projectId/organizationId interact with repositoryId). This meets the baseline for high schema coverage.

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

Purpose5/5

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

The description clearly states the tool's purpose with specific verbs ('summarize', 'surfaces') and resources ('latest status checks and policy evaluations for a pull request'). It distinguishes from siblings like get_pull_request_changes or get_pull_request_comments by focusing on checks/evaluations rather than changes or comments.

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

Usage Guidelines5/5

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

The description explicitly provides usage guidance by stating when to use this tool ('to jump straight to the blocking validation') and pairs it with alternatives ('Pair with pipeline tools (e.g., get_pipeline_run, pipeline_timeline) to inspect failures in depth'). This clearly differentiates it from other tools in the context.

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

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/Tiberriver256/mcp-server-azure-devops'

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