Skip to main content
Glama
piyushgIITian

GitHub Enterprise MCP Server

get-pull-request-status

Retrieve the combined status of all checks for a GitHub pull request to verify if it's ready for merge by providing repository owner, name, and PR number.

Instructions

Get the combined status of all status checks for a pull request

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
ownerYesRepository owner (username or organization)
pull_numberYesPull request number
repoYesRepository name

Implementation Reference

  • The primary handler function for the 'get-pull-request-status' tool. It validates input using GetPullRequestStatusSchema, fetches the PR head SHA, and retrieves combined status checks from GitHub API.
    export async function getPullRequestStatus(args: unknown): Promise<any> {
      const { owner, repo, pull_number } = GetPullRequestStatusSchema.parse(args);
      const github = getGitHubApi();
    
      return tryCatchAsync(async () => {
        // First get the pull request to get the head SHA
        const { data: pr } = await github.getOctokit().pulls.get({
          owner,
          repo,
          pull_number,
        });
    
        // Then get the combined status for the head SHA
        const { data } = await github.getOctokit().repos.getCombinedStatusForRef({
          owner,
          repo,
          ref: pr.head.sha,
        });
    
        return {
          state: data.state,
          statuses: data.statuses.map((status) => ({
            context: status.context,
            state: status.state,
            description: status.description,
            target_url: status.target_url,
            created_at: status.created_at,
            updated_at: status.updated_at,
          })),
          sha: data.sha,
          total_count: data.total_count,
          repository: {
            name: data.repository.name,
            full_name: data.repository.full_name,
            owner: {
              login: data.repository.owner.login,
            },
          },
        };
      }, 'Failed to get pull request status');
    }
  • Zod schema for runtime input validation of the getPullRequestStatus tool parameters.
    export const GetPullRequestStatusSchema = OwnerRepoSchema.extend({
      pull_number: z.number().int().positive(),
    });
  • src/server.ts:927-949 (registration)
    Tool registration in the ListTools response, including name, description, and MCP input schema.
    {
      name: 'get-pull-request-status',
      description: 'Get the combined status of all status checks for a pull request',
      inputSchema: {
        type: 'object',
        properties: {
          owner: {
            type: 'string',
            description: 'Repository owner (username or organization)',
          },
          repo: {
            type: 'string',
            description: 'Repository name',
          },
          pull_number: {
            type: 'number',
            description: 'Pull request number',
          },
        },
        required: ['owner', 'repo', 'pull_number'],
        additionalProperties: false,
      },
    },
  • Dispatcher case in the CallToolRequestHandler switch statement that invokes the getPullRequestStatus handler.
    case 'get-pull-request-status':
      result = await getPullRequestStatus(parsedArgs);
      break;
  • src/server.ts:48-52 (registration)
    Import statement for the getPullRequestStatus function from the pull-requests module.
      getPullRequestStatus,
      updatePullRequestBranch,
      getPullRequestComments,
      getPullRequestReviews,
    } from './tools/pull-requests.js';
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the action ('Get') but doesn't clarify if this is a read-only operation, what permissions are required, how it handles missing data, or the format of the returned status (e.g., aggregated state vs. detailed checks). This leaves significant gaps for an agent to understand the tool's behavior.

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 directly states the tool's purpose without unnecessary words. It's front-loaded with the core action and resource, making it easy to parse quickly.

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 moderate complexity (fetching status checks), lack of annotations, and no output schema, the description is minimally adequate but incomplete. It specifies what is retrieved but omits critical context like authentication needs, error handling, or output format, which could hinder an agent's ability to use it effectively.

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 input schema has 100% description coverage, clearly documenting all three required parameters (owner, repo, pull_number). The description adds no additional parameter semantics beyond what the schema provides, such as format examples or constraints, so it 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.

Purpose4/5

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

The description clearly states the verb ('Get') and resource ('combined status of all status checks for a pull request'), making the purpose specific and understandable. However, it doesn't explicitly differentiate from sibling tools like 'get-pull-request' or 'get-pull-request-reviews', which focus on different aspects of pull requests.

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?

No guidance is provided on when to use this tool versus alternatives. The description doesn't mention prerequisites (e.g., needing repository access) or compare it to related tools like 'get-pull-request' (which might include status info) or 'list-workflow-runs' (which could provide check details).

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/piyushgIITian/github-enterprice-mcp'

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