Skip to main content
Glama

list_branches

Read-only

Lists branches in a GitLab project, with name search and pagination to find specific branches.

Instructions

List branches in project with search filter. For one known resource, use the matching get tool.

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_id": "<project_id>"
    },
    "name": "list_branches"
  }
}

Input Schema

NameRequiredDescriptionDefault
pageNoPage number (default 1)
searchNoSearch term to filter branches by name
summaryNoIf true, return only high-signal fields (id, iid, title, state, web_url, …). Default false keeps the full GitLab JSON.
jmespathNoOptional JMESPath expression filtering the JSON result before return.
per_pageNoItems 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. Changed2 schema fields changedv2.3.22
    • changedInput schema / properties / page / description
      Previous value: -"Page number for pagination (default: 1)"New value: +"Page number (default 1)"
    • changedInput schema / properties / per_page / description
      Previous value: -"Number of items per page (max: 100, default: 20)"New value: +"Items per page (max 100, default 20)"
  2. Changed1 schema field changedv2.3.8
    • addedInput schema / properties / summary
      Added value: +{
      +  "description": "If true, return only high-signal fields (id, iid, title, state, web_url, …). Default false keeps the full GitLab JSON.",
      +  "type": "boolean"
      +}
  3. Changed1 schema field changedv2.1.66
    • addedInput schema / properties / jmespath
      Added value: +{
      +  "description": "Optional JMESPath expression filtering the JSON result before return.",
      +  "type": "string"
      +}
  4. Addedv2.1.18
  5. Removedv2.1.14
  6. Addedv2.1.12

TDQS

B3.4/5.0
Behavior2/5

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

Annotations already declare readOnlyHint=true and openWorldHint=true, so the safety profile is covered. The description adds only the existence of a search filter, which the schema already documents, and says nothing about pagination behavior, default result size, ordering, or how much data a full listing can return — the practical concerns for a list endpoint.

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?

Two short sentences, front-loaded with the primary action and followed by the alternative-route hint. Nothing is padded, though the second sentence is slightly awkwardly worded ('the matching get tool') rather than crisp.

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

Completeness3/5

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

This is a simple read-only list tool with a fully documented schema and annotations covering safety, so not much is required. Still, for a paginated endpoint with a default of 20 and a max of 100, a brief note on pagination or result-size expectations would close the remaining gap.

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, per_page, search, summary, jmespath and project_id are all documented in the schema itself. The description merely echoes the search filter, adding no format, syntax, or interaction detail beyond what the structured fields provide. Baseline 3 applies.

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 gives a specific verb and resource ('List branches in project') plus the scoping modifier ('with search filter'), so an agent immediately knows what the tool returns. It stops short of naming the sibling 'get_branch' explicitly, referring only to 'the matching get tool', which keeps it from a 5.

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?

'For one known resource, use the matching get tool' establishes the list-vs-get split, which is exactly the decision an agent faces here. The guidance is directional but generic — it does not name get_branch or state what counts as a 'known resource' — so it is clear context rather than explicit routing.

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