get_pull_request
Retrieve detailed information about a specific pull request in Backlog projects to review changes, status, and contributors.
Instructions
Returns information about a specific pull request
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| projectId | No | The numeric ID of the project (e.g., 12345) | |
| projectKey | No | The key of the project (e.g., 'PROJECT') | |
| repoId | No | Repository ID | |
| repoName | No | Repository name | |
| number | Yes | Pull request number |
Implementation Reference
- src/tools/getPullRequest.ts:55-77 (handler)The main handler function for the 'get_pull_request' tool. It resolves the project ID or key and repository ID or name using helper functions, then calls the Backlog client's getPullRequest method.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)Zod schema definition for the input parameters of the 'get_pull_request' tool, including optional projectId/projectKey, repoId/repoName, and required number.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:139-139 (registration)Registration of the getPullRequestTool within the 'git' toolset group in the allTools function.getPullRequestTool(backlog, helper),
- src/tools/getPullRequest.ts:54-54 (schema)Output schema reference for the tool response, using PullRequestSchema imported from backlog output definitions.outputSchema: PullRequestSchema,
- src/tools/tools.ts:28-28 (registration)Import of the getPullRequestTool function.import { getPullRequestTool } from './getPullRequest.js';