decline_pull_request
Close a pull request without merging to reject proposed changes in Bitbucket Cloud repositories.
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:947-950 (handler)The tool handler switch case in ToolHandler.handleTool that parses the input arguments using the Zod schema and delegates to PullRequestsAPI.decline to execute the decline action.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/tools/index.ts:105-109 (schema)Zod schema definition for input validation of 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 in toolDefinitions array, including name, description, and JSON input schema.{ 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'], }, },
- src/api/pullrequests.ts:116-127 (helper)PullRequestsAPI.decline method that makes the Bitbucket API POST request to decline the specified pull request./** * Decline a 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` ); }