update_pull_request
Modify existing pull requests by updating details such as summary, description, assignee, issue linkage, and status. Integrates with Backlog for efficient project management.
Instructions
Updates an existing pull request
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| assigneeId | No | User ID of the assignee | |
| description | No | Updates an existing pull request | |
| issueId | No | Issue ID to link | |
| notifiedUserId | No | User IDs to notify | |
| number | Yes | Pull request number | |
| projectIdOrKey | Yes | Project ID or project key | |
| repoIdOrName | Yes | Repository ID or name | |
| statusId | No | Status ID | |
| summary | No | Summary of the pull request |
Implementation Reference
- src/tools/updatePullRequest.ts:90-120 (handler)The asynchronous handler function that implements the core logic of the 'update_pull_request' tool by resolving project and repository IDs and invoking backlog.patchPullRequest.handler: async ({ projectId, projectKey, repoId, repoName, number, ...params }) => { const result = resolveIdOrKey( 'project', { id: projectId, key: projectKey }, t ); if (!result.ok) { throw result.error; } const resultRepo = resolveIdOrKey( 'repository', { id: repoId, key: repoName }, t ); if (!resultRepo.ok) { throw resultRepo.error; } return backlog.patchPullRequest( result.value, String(resultRepo.value), number, params ); },
- src/tools/updatePullRequest.ts:8-73 (schema)The Zod schema defining the input parameters for the update_pull_request tool, including project, repo, PR number, and update fields.const updatePullRequestSchema = buildToolSchema((t) => ({ projectId: z .number() .optional() .describe( t( 'TOOL_UPDATE_PULL_REQUEST_PROJECT_ID', 'The numeric ID of the project (e.g., 12345)' ) ), projectKey: z .string() .optional() .describe( t( 'TOOL_UPDATE_PULL_REQUEST_PROJECT_KEY', "The key of the project (e.g., 'PROJECT')" ) ), repoId: z .number() .optional() .describe(t('TOOL_UPDATE_PULL_REQUEST_REPO_ID', 'Repository ID')), repoName: z .string() .optional() .describe(t('TOOL_UPDATE_PULL_REQUEST_REPO_NAME', 'Repository name')), number: z .number() .describe(t('TOOL_UPDATE_PULL_REQUEST_NUMBER', 'Pull request number')), summary: z .string() .optional() .describe( t('TOOL_UPDATE_PULL_REQUEST_SUMMARY', 'Summary of the pull request') ), description: z .string() .optional() .describe( t( 'TOOL_UPDATE_PULL_REQUEST_DESCRIPTION', 'Description of the pull request' ) ), issueId: z .number() .optional() .describe(t('TOOL_UPDATE_PULL_REQUEST_ISSUE_ID', 'Issue ID to link')), assigneeId: z .number() .optional() .describe( t('TOOL_UPDATE_PULL_REQUEST_ASSIGNEE_ID', 'User ID of the assignee') ), notifiedUserId: z .array(z.number()) .optional() .describe( t('TOOL_UPDATE_PULL_REQUEST_NOTIFIED_USER_ID', 'User IDs to notify') ), statusId: z .number() .optional() .describe(t('TOOL_UPDATE_PULL_REQUEST_STATUS_ID', 'Status ID')), }));
- src/tools/tools.ts:131-131 (registration)Registration of the updatePullRequestTool in the 'git' toolset group within allTools function.updatePullRequestTool(backlog, helper),
- src/tools/tools.ts:43-43 (registration)Import of the updatePullRequestTool for registration.import { updatePullRequestTool } from './updatePullRequest.js';
- src/tools/updatePullRequest.ts:89-89 (schema)Reference to the output schema (PullRequestSchema) for the tool response validation.outputSchema: PullRequestSchema,