Skip to main content
Glama

get_pull_request_status

Retrieve the combined status of all checks for a GitHub pull request by specifying the repository owner, repository name, and pull request 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

  • Core handler function that implements the get_pull_request_status tool logic: fetches the PR to get head SHA, then retrieves and parses the combined commit status from GitHub API.
    export async function getPullRequestStatus( owner: string, repo: string, pullNumber: number ): Promise<z.infer<typeof CombinedStatusSchema>> { // First get the PR to get the head SHA const pr = await getPullRequest(owner, repo, pullNumber); const sha = pr.head.sha; // Then get the combined status for that SHA const response = await githubRequest( `https://api.github.com/repos/${owner}/${repo}/commits/${sha}/status` ); return CombinedStatusSchema.parse(response); }
  • Zod input schema defining parameters for the get_pull_request_status tool: owner, repo, pull_number.
    export const GetPullRequestStatusSchema = z.object({ owner: z.string().describe("Repository owner (username or organization)"), repo: z.string().describe("Repository name"), pull_number: z.number().describe("Pull request number") });
  • index.ts:181-183 (registration)
    Tool registration in the MCP server's list of tools, including name, description, and input schema reference.
    name: "get_pull_request_status", description: "Get the combined status of all status checks for a pull request", inputSchema: zodToJsonSchema(pulls.GetPullRequestStatusSchema)
  • MCP server router handler that parses arguments, calls the core getPullRequestStatus function, and formats the response.
    case "get_pull_request_status": { const args = pulls.GetPullRequestStatusSchema.parse(request.params.arguments); const status = await pulls.getPullRequestStatus(args.owner, args.repo, args.pull_number); return { content: [{ type: "text", text: JSON.stringify(status, null, 2) }], }; }

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

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