Skip to main content
Glama
Bitbucket MCP Server
by pdogra1299

merge_pull_request

Destructive

Merges a Bitbucket pull request, optionally using a version to avoid an extra fetch and prevent overwriting concurrent changes.

Instructions

Merge a pull request. Pass version to save a fetch.

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": {
      "workspace": "<workspace>",
      "repository": "<repository>",
      "pull_request_id": "<pull_request_id>"
    },
    "name": "merge_pull_request"
  }
}

Input Schema

NameRequiredDescriptionDefault
versionNoEntity version from a prior read; supplying it saves a fetch AND makes the write conditional — it fails on concurrent modification instead of overwriting. Omit to write against the latest state (auto-retried once).
workspaceYesProject key (e.g., PROJ)
repositoryYesRepository slug
commit_messageNo
merge_strategyNoCloud only
pull_request_idYesPull request ID
close_source_branchNoCloud only

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed6 schema fields changedv3.0.1
    • changedInput schema / properties / close_source_branch / description
      Previous value: -"Whether to close source branch after merge (optional)"New value: +"Cloud only"
    • removedInput schema / properties / commit_message / description
      Removed value: -"Custom merge commit message (optional)"
    • changedInput schema / properties / merge_strategy / description
      Previous value: -"Merge strategy: merge-commit, squash, fast-forward (optional)"New value: +"Cloud only"
    • changedInput schema / properties / repository / description
      Previous value: -"Repository slug (e.g., \"my-repo\")"New value: +"Repository slug"
    • addedInput schema / properties / version
      Added value: +{
      +  "description": "Entity version from a prior read; supplying it saves a fetch AND makes the write conditional — it fails on concurrent modification instead of overwriting. Omit to write against the latest state (auto-retried once).",
      +  "type": "number"
      +}
    • changedInput schema / properties / workspace / description
      Previous value: -"Bitbucket workspace/project key (e.g., \"PROJ\")"New value: +"Project key (e.g., PROJ)"
  2. First observedv1.0.0

TDQS

C2.8/5.0
Behavior2/5

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

Annotations already declare destructiveHint=true and idempotentHint=false, so the safety profile is covered structurally. The description adds nothing beyond that — it doesn't mention irreversibility, merge-conflict failure modes, permission requirements, or that the PR will be closed. The one extra sentence merely restates the `version` schema note.

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

Conciseness3/5

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

Two short sentences with the action front-loaded, which is good. However the second sentence is redundant with the schema's `version` description, so it doesn't earn its place; the space would be better spent on consequences of merging.

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?

For a destructive 7-parameter mutation with no output schema, the description leaves out what an agent needs: what a successful merge returns, how conflicts surface, and whether the source branch is affected. Annotations cover safety but not outcome behavior.

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 coverage is 86%, so the schema itself documents nearly all parameters including the conditional-write semantics of `version`. The description only echoes the `version` hint, so baseline 3 applies — it neither compensates nor detracts.

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?

States a specific verb and resource ('Merge a pull request'), which is unambiguous against siblings like decline_pull_request or update_pull_request. It doesn't explicitly contrast with those siblings, but the name and verb make selection straightforward.

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 on when to merge versus decline, when a merge is appropriate (e.g., approved review state), or prerequisites. The only usage-adjacent sentence is about passing `version` to save a fetch, which is a parameter tip rather than tool-selection guidance.

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