get_pull_request
Retrieve detailed information for a specific pull request in a Backlog project using project ID, repository ID, and pull request number. Integrates with Backlog MCP Server for efficient project management.
Instructions
Returns information about a specific pull request
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| number | Yes | Pull request number | |
| projectIdOrKey | Yes | Project ID or project key | |
| repoIdOrName | Yes | Repository ID or name |
Implementation Reference
- src/tools/getPullRequest.ts:55-77 (handler)The core handler function that executes the tool logic: resolves project and repository identifiers, then calls the Backlog API to retrieve the specific pull request.handler: async ({ projectId, projectKey, repoId, repoName, number }) => { const result = resolveIdOrKey( 'project', { id: projectId, key: projectKey }, t ); if (!result.ok) { throw result.error; } const repoRes = resolveIdOrName( 'repository', { id: repoId, name: repoName }, t ); if (!repoRes.ok) { throw repoRes.error; } return backlog.getPullRequest( result.value, String(repoRes.value), number ); },
- src/tools/getPullRequest.ts:8-38 (schema)Input schema definition for the get_pull_request tool using Zod and buildToolSchema, supporting project ID/key and repo ID/name.const getPullRequestSchema = buildToolSchema((t) => ({ projectId: z .number() .optional() .describe( t( 'TOOL_GET_PULL_REQUEST_PROJECT_ID', 'The numeric ID of the project (e.g., 12345)' ) ), projectKey: z .string() .optional() .describe( t( 'TOOL_GET_PULL_REQUEST_PROJECT_KEY', "The key of the project (e.g., 'PROJECT')" ) ), repoId: z .number() .optional() .describe(t('TOOL_GET_PULL_REQUEST_REPO_ID', 'Repository ID')), repoName: z .string() .optional() .describe(t('TOOL_GET_PULL_REQUEST_REPO_NAME', 'Repository name')), number: z .number() .describe(t('TOOL_GET_PULL_REQUEST_NUMBER', 'Pull request number')), }));
- src/tools/tools.ts:124-135 (registration)Registration of the getPullRequestTool within the 'git' toolset's tools array in the allTools function, which provides all tool definitions.tools: [ getGitRepositoriesTool(backlog, helper), getGitRepositoryTool(backlog, helper), getPullRequestsTool(backlog, helper), getPullRequestsCountTool(backlog, helper), getPullRequestTool(backlog, helper), addPullRequestTool(backlog, helper), updatePullRequestTool(backlog, helper), getPullRequestCommentsTool(backlog, helper), addPullRequestCommentTool(backlog, helper), updatePullRequestCommentTool(backlog, helper), ],
- src/tools/tools.ts:27-27 (registration)Import of the getPullRequestTool from its implementation file.import { getPullRequestTool } from './getPullRequest.js';
- src/tools/getPullRequest.ts:54-54 (schema)Output schema reference for the tool response validation using PullRequestSchema.outputSchema: PullRequestSchema,