Skip to main content
Glama

delete_branch

Destructive

Permanently removes a remote GitLab branch after verification. Requires branch-delete permission; returns deletion result or errors for protected or missing branches.

Instructions

Delete branch from project. Use this only after confirming the branch name and intended data loss; use get_branch or list_branches before deletion and never use it to remove branch protection. The operation permanently removes a remote branch, requires branch-delete permission, and returns the deletion result or a protected-branch, missing-resource, or permission error.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
jmespathNoOptional JMESPath expression filtering the JSON result before return.
project_idYesProject ID or complete URL-encoded path to project
branch_nameYesName of the branch to delete

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv2.1.66
    • addedInput schema / properties / jmespath
      Added value: +{
      +  "description": "Optional JMESPath expression filtering the JSON result before return.",
      +  "type": "string"
      +}
  2. Changed1 schema field changedv2.1.62
    • changedInput schema / required
      Previous value: -[
      -  "branch_name",
      -  "project_id"
      -]New value: +[
      +  "project_id",
      +  "branch_name"
      +]
  3. Addedv2.1.18
  4. Removedv2.1.14
  5. Addedv2.1.12

TDQS

A4.7/5.0
Behavior5/5

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

Annotations already flag destructive behavior, and the description adds operationally important context: deletion is permanent, it applies to a remote branch, it requires branch-delete permission, and it can return protected-branch, missing-resource, or permission errors. No contradiction with annotations.

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 sentences deliver the core action, safety caveats, permission requirement, and expected results with no filler. The most important warning is front-loaded.

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?

For a three-parameter, side-effectful deletion tool, the description covers prerequisites, irreversibility, permissions, and the possible result/error classes without requiring an output schema. Nothing essential for correct invocation 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%, so the description does not need to repeat parameter details. It adds only contextual reassurance about branch confirmation rather than new parameter-level semantics, which matches the baseline for fully covered schemas.

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?

The description opens with a clear action and target ('Delete branch from project') and later specifies the effect ('permanently removes a remote branch'). It distinguishes delete_branch from get_branch/list_branches/protect_branch rather than merely restating the name.

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?

It gives explicit prerequisites ('use get_branch or list_branches before deletion'), a required confirmation step, and a clear exclusion ('never use it to remove branch protection'). The when-to-use guidance is unambiguous.

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

Deploy Server

Other Tools