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`,
          },
        ],
      };
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries full burden. 'Merge a pull request' implies a destructive write operation, but it lacks critical behavioral details: whether it requires specific permissions, what happens on success/failure (e.g., branch deletion), rate limits, or if it's idempotent. This is inadequate for a mutation tool with zero annotation coverage.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence with zero wasted words. It's appropriately sized for a simple tool name and front-loaded with the core action, though this conciseness comes at the cost of detail.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity of a merge operation (a destructive write with potential side effects), no annotations, and no output schema, the description is incomplete. It fails to explain behavioral traits, error conditions, or return values, leaving significant gaps for an AI agent to use it correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, with all three parameters (workspace, repo_slug, pr_id) documented in the schema. The description adds no parameter-specific information beyond what the schema provides, so it meets the baseline of 3 for high schema coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'Merge a pull request' clearly states the action (merge) and resource (pull request), but it's vague about scope and mechanism. It doesn't specify whether this performs a fast-forward, squash, or merge commit, nor does it distinguish from sibling tools like 'approve_pull_request' or 'create_pull_request' beyond the basic verb.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., pull request must be approved or mergeable), exclusions (e.g., cannot merge if conflicts exist), or related tools like 'approve_pull_request' that might be needed first.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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