approve_pull_request
Approve pull requests in Bitbucket Cloud to merge code changes after review. Use this tool to finalize code reviews and enable merging of approved changes.
Instructions
Approve a pull request.
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:111-115 (schema)Zod schema definition for approve_pull_request tool input validation.approve_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:497-509 (registration)MCP tool registration/definition including name, description, and input schema.{ name: 'approve_pull_request', description: 'Approve a pull request.', 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/tools/index.ts:953-957 (handler)ToolHandler.handleTool case: parses arguments and delegates to PullRequestsAPI.approve.case 'approve_pull_request': { const params = toolSchemas.approve_pull_request.parse(args); await this.prs.approve(params.workspace, params.repo_slug, params.pr_id); return { success: true, message: 'Pull request approved' }; }
- src/api/pullrequests.ts:132-134 (handler)PullRequestsAPI.approve: core implementation that POSTs to Bitbucket API endpoint to approve the PR.async approve(workspace: string, repo_slug: string, pr_id: number): Promise<void> { await this.client.post(`/repositories/${workspace}/${repo_slug}/pullrequests/${pr_id}/approve`); }