Skip to main content
Glama

gitlab_list_branches

Read-onlyIdempotent

List branches of a GitLab project, optionally filtered by name substring. Returns protected, default, merged flags and tip commit details.

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
Behavior5/5

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

The description supplements annotations (readOnlyHint=true, etc.) by detailing what the response includes (default, protected, merged flags, tip commit details). No contradictions; adds valuable behavioral context beyond structured fields.

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 highly concise: two sentences for purpose/details, then examples and anti-pattern. No fluff, every sentence earns its place, and the structure is front-loaded with the most essential information.

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?

Given the presence of annotations and full input schema, the description covers purpose, usage, and behavioral traits well. Minor gaps like explicit pagination behavior are covered by examples. Output schema likely handles return values, so overall completeness is high.

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?

Input schema already fully describes all 4 parameters (100% coverage). The description adds usage examples but does not introduce new parameter semantics beyond what the schema provides. Baseline 3 is appropriate.

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 action (list branches), the resource (project), and the optional substring filter. It distinguishes from sibling tools like gitlab_list_tags and gitlab_list_merge_requests by focusing on branches and including specific flags and commit info.

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 provides concrete examples for common use cases (search, pagination) and explicitly warns against using this tool for exact branch existence checks, recommending gitlab_get_file as an alternative. This is excellent usage guidance.

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