Skip to main content
Glama
bitbucket-mcp

bitbucket-mcp

by nevzatcirak

Merge pull request

bb_merge_pull_request

Merge a Bitbucket pull request with an optional commit message and strategy; after a 409 conflict, re-run canMerge before merging again.

Instructions

Merge a pull request with optional message and strategy (merge-commit | squash | fast-forward; translated to Cloud ids merge_commit | squash | fast_forward). On 409 (Server/DC) the merge is NOT retried automatically — a new commit likely landed; re-run canMerge then merge again.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "projectKey": "<projectKey>",
      "repositorySlug": "<repositorySlug>",
      "pullRequestId": "<pullRequestId>"
    },
    "name": "bb_merge_pull_request"
  }
}

Input Schema

NameRequiredDescriptionDefault
messageNoMerge commit message.
strategyNoMerge strategy id (server default applies when omitted).
projectKeyYesProject key (target repository; on Cloud: workspace slug).
pullRequestIdYesPull request id.
repositorySlugYesTarget repository slug.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.4.0

TDQS

A3.6/5.0
Behavior3/5

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

With no annotations, the description carries the full behavioral burden. It does disclose the non-retry behavior on 409, the likely cause (a new commit landed), and the strategy-to-API-id translation, which are meaningful additions. It does not disclose whether the merge is irreversible, what permissions are required, or what the successful response looks like, leaving significant gaps for a mutation tool.

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?

Two tight sentences with no filler. The primary purpose and optional arguments are front-loaded, and the error-handling caveat follows in a compact conditional clause; every sentence earns its place.

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

Completeness3/5

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

Given a mutation tool with five parameters, no annotations, and no output schema, the description covers the error path well but omits the success path and the safety profile. An agent still lacks information about permissions, irreversibility, and the shape of a successful result, which are more important here than for a read tool.

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

Parameters4/5

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

Schema description coverage is 100%, so the baseline is 3, but the description adds meaning beyond the schema by specifying the mapping from user-facing strategy values (merge-commit | squash | fast-forward) to the underlying API ids (merge_commit | squash | fast_forward). That translation is not present in the schema's enum or parameter descriptions and prevents a plausible invocation error.

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

Purpose4/5

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

The description opens with a specific verb and resource ('Merge a pull request') and enumerates the optional inputs (message, strategy), so the core action is unambiguous. It references canMerge in the error-recovery note, which hints at the relationship with bb_can_merge_pull_request, but it never explicitly distinguishes itself from that sibling or states that this is the write operation following a precheck.

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

Usage Guidelines3/5

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

Usage is implied by the operation itself, and there is a genuinely useful conditional guideline for the 409 conflict case ('re-run canMerge then merge again'). However, there is no explicit when-to-use versus alternative guidance, no mention of prerequisites such as required permissions or an approved review, and no statement of when merging should not be attempted.

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