Skip to main content
Glama

list_branches

Read-only

List all branches in a GitLab project with an optional search filter. Use it to browse project branches by name before picking a specific branch.

Instructions

List branches in project with search filter. For one known resource, use the matching get tool. Read-only; missing resources, denied access, and rate limits return errors. project_id/group_id take a numeric ID or URL-encoded path.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pageNoPage number for pagination (default: 1)
searchNoSearch term to filter branches by name
jmespathNoOptional JMESPath expression filtering the JSON result before return.
per_pageNoNumber of items per page (max: 100, default: 20)
project_idYesProject ID or complete URL-encoded path to project

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. Addedv2.1.18
  3. Removedv2.1.14
  4. Addedv2.1.12

TDQS

A4.1/5.0
Behavior4/5

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

Annotations already declare readOnlyHint and openWorldHint, but the description adds real behavioral context: missing resources, denied access, and rate limits all surface as errors. It also notes the ID-or-URL-encoded-path acceptance, which is operationally useful. Minor noise: it references `group_id`, which is not a parameter in this schema.

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-loads the core action and scope in the first clause, then layers routing and error behavior in short sentences. It is compact and free of filler, though the trailing ID/path sentence is somewhat redundant with the schema.

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

Completeness4/5

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

With no output schema, the description appropriately carries the burden of disclosing error semantics and ID formats, and pagination is covered by the schema. Nothing critical is missing for a filtered list call, though it could say more about result ordering or page-size behavior.

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 page, search, jmespath, per_page and project_id are all already documented in the schema, establishing a baseline of 3. The description's ID/path note largely restates the schema's project_id description and introduces a `group_id` that does not exist as a parameter, so it adds little net value.

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 in project') plus the scoping modifier ('with search filter'). It also distinguishes itself from the single-resource sibling by routing 'for one known resource' to the matching get tool, so an agent can separate it from get_branch without opening a schema.

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

Usage Guidelines4/5

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

Gives an explicit alternative and the condition that selects it ('for one known resource, use the matching get tool'), which is exactly the branch vs. branch-list routing decision. It stops short of stating when-not to use search or how results differ from other list tools, so it is clear context rather than full when/when-not coverage.

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