Skip to main content
Glama

Delete merged branches

gitlab_delete_merged_branches
DestructiveIdempotent

Delete all merged branches in a GitLab project to clear stale branches after merge and reduce repository clutter.

Instructions

Delete all merged branches in a project.

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

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_merged_branches"
  }
}

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 and idempotentHint=true, so the safety profile is covered. The description adds real value with '(no data for successful deletion)' and the enumerated error types (MissingParameterError, ParameterError), but says nothing about which branches are actually eligible (protected? default branch?) or that confirm is required for headless clients.

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 the auto-generated Args/Returns/Raises blocks add boilerplate, and the '**kwargs' line is both inaccurate and unhelpful for a schema with fixed properties. Roughly half the text does not earn its place.

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, open-world bulk-delete with seven parameters, no output schema and 14% schema coverage, the definition is thin: it omits what 'merged' means precisely, whether protected/default branches are skipped, pagination behavior (page/per_page/max_pages), and the role of ref and branch. The one genuinely useful addition is the confirmation and error documentation.

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% (just 'confirm'), so the description must compensate and does not. It mentions only '**kwargs ... (e.g., project_id)', which is actively misleading since the schema has seven explicit properties and additionalProperties=false; ref, branch, page, per_page and max_pages are left fully undocumented.

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 scope: 'Delete all merged branches in a project.' An agent can distinguish this from a single-branch delete by the word 'all', but the description never names the closely related sibling gitlab_delete_branch, so routing must be inferred from the title alone.

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 bulk cleanup versus gitlab_delete_branch for a single branch, no prerequisites (permissions, whether it operates on protected branches), and no note about when the 'confirm' flag matters. The docstring boilerplate occupies the space where usage guidance should be.

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