approve_pull_request
Approve pull requests in Bitbucket repositories to merge code changes after review. Specify workspace, repository, and pull request ID to complete the approval process.
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/BitbucketClient.ts:163-165 (handler)The implementation of the approvePullRequest method in the BitbucketClient class.
async approvePullRequest(workspace: string, repoSlug: string, prId: number): Promise<void> { await this.api.post(`/repositories/${workspace}/${repoSlug}/pullrequests/${prId}/approve`); } - src/index.ts:203-224 (schema)The tool definition (schema) for 'approve_pull_request'.
{ name: 'approve_pull_request', description: 'Approve a pull request', inputSchema: { type: 'object', 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/index.ts:529-544 (registration)The handler logic in index.ts that calls approvePullRequest when the 'approve_pull_request' tool is requested.
case 'approve_pull_request': { const { workspace, repo_slug, pr_id } = args as { workspace: string; repo_slug: string; pr_id: number; }; await client.approvePullRequest(workspace, repo_slug, pr_id); return { content: [ { type: 'text', text: `Pull request #${pr_id} approved successfully`, }, ], }; }