get_pull_requests
Retrieve pull requests from a Backlog repository with filtering options for status, assignee, issue, and creator to manage code review workflows.
Instructions
Returns list of pull requests for a repository
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 | |
| statusId | No | Status IDs | |
| assigneeId | No | Assignee user IDs | |
| issueId | No | Issue IDs | |
| createdUserId | No | Created user IDs | |
| offset | No | Offset for pagination | |
| count | No | Number of pull requests to retrieve |
Implementation Reference
- src/tools/getPullRequests.ts:78-100 (handler)The handler function for the 'get_pull_requests' tool. It resolves project and repository IDs/names, then calls backlog.getPullRequests with the parameters.handler: async ({ projectId, projectKey, repoId, repoName, ...params }) => { const result = resolveIdOrKey( 'project', { id: projectId, key: projectKey }, t ); if (!result.ok) { throw result.error; } const repoResult = resolveIdOrName( 'repository', { id: repoId, name: repoName }, t ); if (!repoResult.ok) { throw repoResult.error; } return backlog.getPullRequests( result.value, String(repoResult.value), params ); },
- src/tools/getPullRequests.ts:8-61 (schema)Input schema definition for the 'get_pull_requests' tool using Zod.const getPullRequestsSchema = buildToolSchema((t) => ({ projectId: z .number() .optional() .describe( t( 'TOOL_GET_PULL_REQUESTS_PROJECT_ID', 'The numeric ID of the project (e.g., 12345)' ) ), projectKey: z .string() .optional() .describe( t( 'TOOL_GET_PULL_REQUESTS_PROJECT_KEY', "The key of the project (e.g., 'PROJECT')" ) ), repoId: z .number() .optional() .describe(t('TOOL_GET_PULL_REQUESTS_REPO_ID', 'Repository ID')), repoName: z .string() .optional() .describe(t('TOOL_GET_PULL_REQUESTS_REPO_NAME', 'Repository name')), statusId: z .array(z.number()) .optional() .describe(t('TOOL_GET_PULL_REQUESTS_STATUS_ID', 'Status IDs')), assigneeId: z .array(z.number()) .optional() .describe(t('TOOL_GET_PULL_REQUESTS_ASSIGNEE_ID', 'Assignee user IDs')), issueId: z .array(z.number()) .optional() .describe(t('TOOL_GET_PULL_REQUESTS_ISSUE_ID', 'Issue IDs')), createdUserId: z .array(z.number()) .optional() .describe(t('TOOL_GET_PULL_REQUESTS_CREATED_USER_ID', 'Created user IDs')), offset: z .number() .optional() .describe(t('TOOL_GET_PULL_REQUESTS_OFFSET', 'Offset for pagination')), count: z .number() .optional() .describe( t('TOOL_GET_PULL_REQUESTS_COUNT', 'Number of pull requests to retrieve') ), }));
- src/tools/tools.ts:137-137 (registration)Registration of the 'get_pull_requests' tool in the 'git' toolset within the allTools function.getPullRequestsTool(backlog, helper),