get_pull_request
Retrieve detailed information about a specific pull request by specifying the repository owner, repository name, and pull request number.
Instructions
Get details of a specific 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:179-188 (handler)Core implementation of getPullRequest: fetches the pull request details from GitHub API using githubRequest and parses with GitHubPullRequestSchema.export async function getPullRequest( owner: string, repo: string, pullNumber: number ): Promise<z.infer<typeof GitHubPullRequestSchema>> { const response = await githubRequest( `https://api.github.com/repos/${owner}/${repo}/pulls/${pullNumber}` ); return GitHubPullRequestSchema.parse(response); }
- operations/pulls.ts:90-94 (schema)Input schema (GetPullRequestSchema) defining parameters: owner, repo, pull_number.export const GetPullRequestSchema = 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:156-158 (registration)Tool registration in the list_tools handler, including name, description, and input schema.name: "get_pull_request", description: "Get details of a specific pull request", inputSchema: zodToJsonSchema(pulls.GetPullRequestSchema)
- index.ts:498-504 (handler)MCP CallToolRequest handler case that parses arguments and calls the core getPullRequest function.case "get_pull_request": { const args = pulls.GetPullRequestSchema.parse(request.params.arguments); const pullRequest = await pulls.getPullRequest(args.owner, args.repo, args.pull_number); return { content: [{ type: "text", text: JSON.stringify(pullRequest, null, 2) }], }; }