Skip to main content
Glama
jlromano

Bitbucket MCP Server

by jlromano

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

Implementation Reference

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

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/jlromano/bitbucket-mcp'

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