Skip to main content
Glama

gitlab_list_branches

Read-onlyIdempotent

List and filter project branches with details like protection status and commit information to manage GitLab repository structure.

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.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
searchNoSubstring match on branch name (case-insensitive).
per_pageNoItems per page (1–100).
pageNo1-based page number.
project_pathNoGitLab project path (e.g. 'my-org/my-repo'). When omitted, the default from GITLAB_PROJECT_PATH env var is used.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
projectYes
countYes
paginationYes
branchesYes
Behavior4/5

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

Annotations already provide readOnlyHint=true, destructiveHint=false, idempotentHint=true, and openWorldHint=true, covering the core safety profile. The description adds valuable behavioral context beyond annotations by specifying what information is included in the response ('Includes default, protected and merged flags, and the short id of the tip commit with its title and date') and providing pagination guidance ('Next page of branches'). This enhances the agent's understanding of the tool's behavior.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is efficiently structured with a clear purpose statement, response details, practical examples, and usage guidance in just four sentences. Every sentence adds value: the first states the core functionality, the second describes response content, the third provides parameter examples, and the fourth gives explicit usage boundaries. No wasted words or redundancy.

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 the tool's moderate complexity, comprehensive annotations (readOnly, non-destructive, idempotent, open world), 100% schema coverage, and the presence of an output schema, the description provides complete contextual information. It covers purpose, response format, parameter examples, and usage boundaries without needing to explain return values (handled by output schema) or repeat safety information (covered by annotations).

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?

With 100% schema description coverage, the schema already fully documents all 4 parameters. The description adds minimal parameter semantics beyond the schema through the examples ('search='release'', 'page=2'), but doesn't provide significant additional meaning about parameter usage or relationships. This meets the baseline expectation when schema coverage is complete.

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?

The description clearly states the specific action ('List branches of a project') and resource ('branches'), distinguishing it from sibling tools like gitlab_get_file (for checking specific branches) and gitlab_list_tags (for listing tags instead). It provides a precise verb+resource combination with optional filtering scope.

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?

The description explicitly provides when-to-use guidance with a concrete example ('List all branches with 'release' in name') and when-not-to-use guidance ('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'). It names the alternative tool and provides clear context for usage decisions.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/mshegolev/gitlab-ci-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server