get_pull_request
Retrieve detailed information about a specific GitHub pull request by providing its number to support project management and code review workflows.
Instructions
Get details of a specific pull request
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| pullNumber | Yes |
Implementation Reference
- Core implementation of get_pull_request tool: fetches detailed pull request information using GitHub REST API via Octokitasync getPullRequest(data: { pullNumber: number; }): Promise<{ number: number; title: string; body: string; state: string; user: string; createdAt: string; updatedAt: string; mergeable: boolean | null }> { try { const octokit = this.factory.getOctokit(); const config = this.factory.getConfig(); const response = await octokit.rest.pulls.get({ owner: config.owner, repo: config.repo, pull_number: data.pullNumber }); return { number: response.data.number, title: response.data.title, body: response.data.body || '', state: response.data.state, user: response.data.user?.login || 'unknown', createdAt: response.data.created_at, updatedAt: response.data.updated_at, mergeable: response.data.mergeable }; } catch (error) { throw this.mapErrorToMCPError(error); } }
- Tool definition including schema, description, and examples for get_pull_requestexport const getPullRequestTool: ToolDefinition<GetPullRequestArgs> = { name: "get_pull_request", description: "Get details of a specific pull request", schema: getPullRequestSchema as unknown as ToolSchema<GetPullRequestArgs>, examples: [ { name: "Get PR details", description: "Retrieve information about PR #42", args: { pullNumber: 42 } } ] };
- src/infrastructure/tools/ToolRegistry.ts:225-231 (registration)Registration of getPullRequestTool in the central ToolRegistry during built-in tools initializationthis.registerTool(createPullRequestTool); this.registerTool(getPullRequestTool); this.registerTool(listPullRequestsTool); this.registerTool(updatePullRequestTool); this.registerTool(mergePullRequestTool); this.registerTool(listPullRequestReviewsTool); this.registerTool(createPullRequestReviewTool);
- src/index.ts:346-347 (handler)MCP server dispatch handler that routes get_pull_request calls to ProjectManagementService.getPullRequestcase "get_pull_request": return await this.service.getPullRequest(args);