Skip to main content
Glama
jlromano

Bitbucket MCP Server

by jlromano

merge_pull_request

Merge a pull request in Bitbucket by specifying workspace, repository, and pull request ID to complete code integration.

Instructions

Merge a pull request

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
workspaceYesThe workspace slug
repo_slugYesThe repository slug
pr_idYesThe pull request ID

Implementation Reference

  • The actual implementation of the pull request merge operation calling the Bitbucket API.
    async mergePullRequest(workspace: string, repoSlug: string, prId: number): Promise<void> {
      await this.api.post(`/repositories/${workspace}/${repoSlug}/pullrequests/${prId}/merge`);
    }
  • src/index.ts:226-245 (registration)
    Registration of the merge_pull_request tool with its input schema.
    name: 'merge_pull_request',
    description: 'Merge 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'],
    },
  • The tool handler switch case block that invokes the BitbucketClient method.
    case 'merge_pull_request': {
      const { workspace, repo_slug, pr_id } = args as {
        workspace: string;
        repo_slug: string;
        pr_id: number;
      };
      await client.mergePullRequest(workspace, repo_slug, pr_id);
      return {
        content: [
          {
            type: 'text',
            text: `Pull request #${pr_id} merged 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