Skip to main content
Glama

Delete a branch

delete_branch
DestructiveIdempotent

Deletes a repository branch in write mode, refusing default and protected branches; check merged status first because commits only that branch held become unreachable.

Instructions

Delete a branch (owner/repo/branch; requires write mode). The forge refuses the default branch and protected branches. Commits only that branch held become unreachable, so check it is merged first (get_pull_request's merged).

Input Schema

NameRequiredDescriptionDefault
repoYesRepository name.
ownerYesRepository owner.
branchYesBranch to delete, e.g. `feature/login`.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.26.0

TDQS

A4.7/5.0
Behavior5/5

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

Annotations already declare destructiveHint=true and idempotentHint=true, but the description goes further: it names server-side refusal rules (default/protected branches) and the real consequence (commits only that branch held become unreachable). That is exactly the irreversible-effect context annotations cannot express.

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?

Three short sentences, front-loaded with verb and resource, then constraints, then the data-loss warning with its mitigation. No filler and no repetition of the annotations.

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

Completeness5/5

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

A destructive mutation with no output schema needs prerequisites, refusal behavior, and consequence disclosure, and all three are present. Nothing an agent needs to call it safely is missing.

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% and each parameter is already documented, including the `feature/login` example for branch. The description's '(owner/repo/branch)' restates the required trio but adds no syntax or constraint detail beyond the schema, so the baseline 3 applies.

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

Purpose5/5

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

States a specific verb and resource ('Delete a branch') and immediately scopes it to owner/repo/branch. An agent can distinguish it from create_branch and delete_repo without opening any schema.

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

Usage Guidelines5/5

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

Gives an explicit prerequisite ('requires write mode'), explicit exclusions (the forge refuses default and protected branches), and a pre-condition cross-reference (check `merged` via get_pull_request). This is when-to-use, when-not-to-use, and the alternative in three clauses.

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