Skip to main content
Glama
Lexmata

Bitbucket Cloud MCP Server

by Lexmata

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
NameRequiredDescriptionDefault
workspaceYesThe workspace slug
repo_slugYesThe repository slug
pr_idYesThe pull request ID

Implementation Reference

  • 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'),
    }),
  • 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'],
      },
    },
  • 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' };
    }
  • 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`);
    }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Lexmata/bitbucket-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server