Skip to main content
Glama

gitlab_list_branches

Read-onlyIdempotent

List GitLab project branches with optional substring filtering, returning default, protected, and merged flags plus tip commit ID, title, and date for branch review or selection.

Instructions

List branches of a project, optionally filtered by substring.

Includes default, protected and merged flags, and the short id of the tip commit with its title and date.

Examples: - "List all branches with 'release' in name" → search='release' - "Next page of branches" → page=2 - Don't use when you want to check if a specific branch exists by exact name — use gitlab_get_file on that ref and look at the error instead.

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": {
      "project_path": "<project_path>"
    },
    "name": "gitlab_list_branches"
  }
}

Input Schema

NameRequiredDescriptionDefault
pageNo1-based page number.
searchNoSubstring match on branch name (case-insensitive).
per_pageNoItems per page (1–100).
project_pathYesGitLab project path (e.g. 'my-org/my-repo'). Required by default. For legacy deployments only, set GITLAB_ALLOW_DEFAULT_PROJECT=true to use GITLAB_PROJECT_PATH when omitted.

Output Schema

NameRequiredDescriptionDefault
countYes
projectYes
branchesYes
paginationYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed6 schema fields changedv0.5.5
    • removedInput schema / properties / project_path / anyOf
      Removed value: -[
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • removedInput schema / properties / project_path / default
      Removed value: -null
    • changedInput schema / properties / project_path / description
      Previous value: -"GitLab project path (e.g. 'my-org/my-repo'). When omitted, the default from GITLAB_PROJECT_PATH env var is used."New value: +"GitLab project path (e.g. 'my-org/my-repo'). Required by default. For legacy deployments only, set GITLAB_ALLOW_DEFAULT_PROJECT=true to use GITLAB_PROJECT_PATH when omitted."
    • addedInput schema / properties / project_path / minLength
      Added value: +1
    • addedInput schema / properties / project_path / type
      Added value: +"string"
    • addedInput schema / required
      Added value: +[
      +  "project_path"
      +]
  2. First observedv0.5.1

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already declare readOnly, idempotent, non-destructive, openWorld. The description goes beyond them by disclosing what the response contains (default, protected, merged flags, tip commit short id with title and date), which helps an agent decide if this tool answers its question. It does not discuss rate limits or result-size behavior, so not a 5.

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?

Front-loaded purpose sentence followed by response-content notes and three compact examples; nearly every line earns its place. Minor waste from the reStructuredText-style backticks and a slightly rambling exclusion sentence.

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?

Given rich annotations, a 100%-covered schema, and an output schema, nothing an agent needs is missing: purpose, filtering, pagination, returned fields, and the key mis-invocation trap are all covered.

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 schema already documents project_path, search, page, and per_page semantics. The description adds only a light mapping example ('release' → search='release', next page → page=2), which is marginal over the schema. 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 ('List branches of a project') plus the filtering scope, and distinguishes itself from gitlab_get_file as the way to check exact branch existence. An agent can identify this tool's role without opening the 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?

Provides explicit when-to-use examples (substring filter via search, pagination via page) and an explicit when-not-to-use rule with a named alternative ('Don't use when you want to check if a specific branch exists... use gitlab_get_file'). That is the full when/when-not/alternative triad.

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