Skip to main content
Glama

Delete branch

gitlab_delete_branch
DestructiveIdempotent

Delete a specified branch from a GitLab project via the API, with explicit confirmation for the destructive action.

Instructions

Delete a branch in a project.

Args: **kwargs: Additional parameters for the request (e.g., project_id, branch).

Returns: Response: The response object (no data for successful deletion).

Raises: MissingParameterError: If required parameters are missing. ParameterError: If invalid parameters are provided.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "gitlab_delete_branch"
  }
}

Input Schema

NameRequiredDescriptionDefault
refNo
pageNo
branchNo
confirmNoExplicitly confirm this destructive operation. Needed only when the client cannot answer a confirmation prompt.
per_pageNo
max_pagesNo
project_idNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed5 schema fields changedv27.3.20
    • removedInput schema / properties / api_parameters
      Removed value: -{
      -  "anyOf": [
      -    {
      -      "additionalProperties": true,
      -      "type": "object"
      -    },
      -    {
      -      "type": "null"
      -    }
      -  ],
      -  "default": null
      -}
    • changedInput schema / properties / page / default
      Previous value: -1New value: +null
    • changedInput schema / properties / per_page / default
      Previous value: -100New value: +null
    • addedInput schema / properties / project_id / default
      Added value: +null
    • removedInput schema / required
      Removed value: -[
      -  "project_id"
      -]
  2. Changed1 schema field changedv27.3.18
    • addedInput schema / properties / confirm
      Added value: +{
      +  "default": false,
      +  "description": "Explicitly confirm this destructive operation. Needed only when the client cannot answer a confirmation prompt.",
      +  "type": "boolean"
      +}
  3. First observedv27.3.13

TDQS

C2.8/5.0
Behavior3/5

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

Annotations already declare destructiveHint=true, idempotentHint=true, and openWorldHint=true, so the risk profile is covered. The description adds the return behavior ('no data for successful deletion') and names the error classes raised, which is mildly useful, but it omits the important fact that a 'confirm' flag exists for destructive confirmation and says nothing about permission or protected-branch failures.

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?

The opening sentence is front-loaded and efficient, but it is followed by generic docstring boilerplate (Args/Returns/Raises) whose main Args content is an inaccurate kwargs catch-all. The errors block is reasonable; the kwargs line costs credibility rather than adding information.

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, seven-parameter tool with no output schema and near-zero schema documentation, the description is too thin — it never explains how to identify the target branch, what ref does, or how the confirm flag interacts with clients. An agent could easily call it with no parameters at all and get an unexpected error.

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

Parameters2/5

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

Schema description coverage is only 14%, so the description must compensate, yet it only echoes 'project_id' and 'branch' — the two self-evident names — and leaves ref, confirm, page, per_page, and max_pages unexplained. The '**kwargs' framing is misleading given the schema sets additionalProperties: false, and it never notes that project_id and branch are effectively required despite zero formally required fields.

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 states a specific verb and resource ('Delete a branch in a project'), which is unambiguous at a glance. It does not distinguish itself from nearby siblings such as gitlab_delete_merged_branches, gitlab_create_branch, or gitlab_get_branch, so the agent has to infer the boundary.

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?

There is no guidance on when to use this versus gitlab_delete_merged_branches or the broader gitlab_api_request, and no mention of prerequisites such as protection status or permissions. No warning that branch deletion is irreversible is offered beyond the annotations flag.

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