Skip to main content
Glama

Get branches

gitlab_get_branches
Read-onlyIdempotent

Retrieve branches in a GitLab project to inspect available refs, branch names, and pagination details. Use project_id and optional filters to list branches for review or automation.

Instructions

Retrieve information about branches in a project.

Args: **kwargs: Additional keyword arguments to initialize the BranchModel.

Returns: Response: The response object containing a list of Branch models.

Raises: ParameterError: If the provided parameters are invalid based on the BranchModel.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "gitlab_get_branches"
  }
}

Input Schema

NameRequiredDescriptionDefault
refNo
pageNo
branchNo
per_pageNo
max_pagesNo
project_idNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed5 schema fields changedv27.3.20
    • removedInput schema / properties / api_parameters
      Removed value: -{
      -  "anyOf": [
      -    {
      -      "additionalProperties": true,
      -      "type": "object"
      -    },
      -    {
      -      "type": "null"
      -    }
      -  ],
      -  "default": null
      -}
    • changedInput schema / properties / page / default
      Previous value: -1New value: +null
    • changedInput schema / properties / per_page / default
      Previous value: -100New value: +null
    • addedInput schema / properties / project_id / default
      Added value: +null
    • removedInput schema / required
      Removed value: -[
      -  "project_id"
      -]
  2. First observedv27.3.13

TDQS

C2.5/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=true, idempotentHint=true, destructiveHint=false and openWorldHint=true, so the safety profile is covered. The description adds only that a ParameterError is raised for invalid parameters, which is modest but real value. It says nothing about how pagination or max_pages limits the result set, which is the main behavioral unknown 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.

Conciseness2/5

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

The one substantive sentence leads, which is good, but it is followed by auto-generated docstring scaffolding ("Args: **kwargs", "Returns: Response object", "Raises: ParameterError") that adds no actionable information. The useful content is a single line padded out to three sections.

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?

Placeholder for a corrected completeness assessment: given six fully undocumented parameters, no output schema, and no differentiation from gitlab_get_branch, the definition is not sufficient on its own. An agent would have to guess at ref/branch semantics and pagination before calling it correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters1/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0% across six parameters (ref, page, branch, per_page, max_pages, project_id), so the description carries the full explanatory burden and does not meet it. Its only parameter-related text is the boilerplate "**kwargs: Additional keyword arguments to initialize the BranchModel," which explains nothing and does not even name the real parameters.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

"Retrieve information about branches in a project" names a resource and an action, so the general intent is legible. But it never states that this returns a *list* of branches (as opposed to a single branch), which is the only thing separating it from the sibling gitlab_get_branch, and the phrase "information about" is vague about what fields come back.

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

Usage Guidelines2/5

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

There is no guidance on when to use this versus gitlab_get_branch (single branch), gitlab_get_protected_branches, or gitlab_get_tags. No prerequisites such as whether project_id is required, and no mention of pagination behavior even though three pagination parameters exist.

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

Deploy Server

Other Tools