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
| Name | Required | Description | Default |
|---|---|---|---|
| owner | Yes | Repository owner (username or organization) | |
| pull_number | Yes | Pull request number | |
| repo | Yes | Repository name |
Implementation Reference
- operations/pulls.ts:288-302 (handler)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); }
- operations/pulls.ts:137-141 (schema)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)
- index.ts:541-547 (handler)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) }], }; }