Skip to main content
Glama
Bitbucket MCP Server
by pdogra1299

delete_branch

DestructiveIdempotent

Deletes a Bitbucket branch by workspace, repository, and branch name; optionally provide expected_head SHA to skip lookup and enforce compare-and-swap.

Instructions

Delete a branch. Pass expected_head (commit SHA) to skip the lookup call (Server).

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>",
      "branch_name": "<branch_name>"
    },
    "name": "delete_branch"
  }
}

Input Schema

NameRequiredDescriptionDefault
workspaceYesProject key (e.g., PROJ)
repositoryYesRepository slug
branch_nameYes
expected_headNoKnown head SHA (compare-and-swap)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed5 schema fields changedv3.0.1
    • removedInput schema / properties / branch_name / description
      Removed value: -"Branch name to delete"
    • addedInput schema / properties / expected_head
      Added value: +{
      +  "description": "Known head SHA (compare-and-swap)",
      +  "type": "string"
      +}
    • removedInput schema / properties / force
      Removed value: -{
      -  "description": "Force delete even if branch is not merged (optional, default: false)",
      -  "type": "boolean"
      -}
    • changedInput schema / properties / repository / description
      Previous value: -"Repository slug (e.g., \"my-repo\")"New value: +"Repository slug"
    • 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

A3.5/5.0
Behavior3/5

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

Annotations already declare destructiveHint=true and idempotentHint=true, so the safety profile is covered. The description adds a genuinely useful behavioral detail — that expected_head is a compare-and-swap that avoids an extra lookup — but says nothing about irreversibility, required permissions, or what happens to open pull requests on the deleted branch.

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

Conciseness4/5

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

Two short sentences, action first, optimization hint second — well front-loaded. The trailing "(Server)" is cryptic noise that slightly undercuts an otherwise lean statement.

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?

For a destructive mutation with no output schema, the description omits failure modes (e.g., what a stale expected_head returns), protection/permission requirements, and consequences for related resources. Annotations carry the safety signal, but an agent still lacks enough to handle errors confidently.

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 coverage is 75%, with branch_name entirely undescribed in the schema; the description implicitly identifies it as the target. More importantly, it explains the practical benefit of expected_head (skip the lookup) beyond the schema's terse "Known head SHA (compare-and-swap)", which is real added meaning.

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?

"Delete a branch" is a precise verb+resource statement that cleanly separates it from read-oriented siblings like list_branches and get_branch. It does not explicitly name alternatives, but the operation is unambiguous.

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?

The only usage guidance is conditional: pass expected_head to skip a lookup call. There is no statement of when to prefer this over other branch operations, no prerequisites (e.g., branch protection, permissions), and no caution about the destructive nature of the call.

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