decline_pull_request
Decline or close a pull request without merging it in Bitbucket Cloud repositories. Use this tool to reject changes that don't meet requirements or need revision.
Instructions
Decline/close a pull request without merging.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| workspace | Yes | The workspace slug | |
| repo_slug | Yes | The repository slug | |
| pr_id | Yes | The pull request ID |
Implementation Reference
- src/tools/index.ts:949-952 (handler)The main handler logic for the 'decline_pull_request' tool within ToolHandler.handleTool method. It validates input using Zod schema and calls the PullRequestsAPI.decline method.case 'decline_pull_request': { const params = toolSchemas.decline_pull_request.parse(args); return this.prs.decline(params.workspace, params.repo_slug, params.pr_id); }
- src/api/pullrequests.ts:119-127 (helper)The supporting API method in PullRequestsAPI that executes the Bitbucket API POST request to decline the specified pull request.async decline( workspace: string, repo_slug: string, pr_id: number ): Promise<BitbucketPullRequest> { return this.client.post<BitbucketPullRequest>( `/repositories/${workspace}/${repo_slug}/pullrequests/${pr_id}/decline` ); }
- src/tools/index.ts:105-109 (schema)Zod input schema definition for the 'decline_pull_request' tool parameters.decline_pull_request: z.object({ workspace: z.string().describe('The workspace slug'), repo_slug: z.string().describe('The repository slug'), pr_id: z.number().describe('The pull request ID'), }),
- src/tools/index.ts:484-496 (registration)MCP tool registration entry including name, description, and JSON Schema for input validation.{ name: 'decline_pull_request', description: 'Decline/close a pull request without merging.', inputSchema: { type: 'object' as const, properties: { workspace: { type: 'string', description: 'The workspace slug' }, repo_slug: { type: 'string', description: 'The repository slug' }, pr_id: { type: 'number', description: 'The pull request ID' }, }, required: ['workspace', 'repo_slug', 'pr_id'], }, },