Skip to main content
Glama

Get branch

gitlab_get_branch
Read-onlyIdempotent

Fetch details for a named branch in a GitLab project using project ID and branch name, so you can inspect branch metadata and verify its state.

Instructions

Retrieve information about a specific branch in a project.

Args: **kwargs: Additional parameters for the request (e.g., project_id, branch).

Returns: Response: The response object containing a Branch model.

Raises: MissingParameterError: If the project ID or branch is missing. ParameterError: If invalid parameters are provided.

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_branch"
  }
}

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.9/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 elsewhere. The description adds genuinely useful error behavior (MissingParameterError when project ID or branch is absent, ParameterError on bad input), which goes beyond the annotations. It does not mention pagination behavior despite page/per_page/max_pages being available.

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 first sentence is clean and front-loaded, but it is followed by docstring boilerplate: an Args block documenting only **kwargs, which is not an actual parameter in the schema and is misleading. That boilerplate consumes most of the text without adding usable 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?

The tool is simple and the description covers the core purpose and error behavior, but the Args block documenting only **kwargs is misleading, and four of six parameters (ref, page, per_page, max_pages) are undocumented in both schema and description. That leaves real gaps in a 6-parameter tool despite otherwise adequate coverage.

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

Parameters2/5

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

Schema description coverage is 0% across 6 parameters, so the description must compensate and largely does not. It names only project_id and branch, folded into a generic "**kwargs" line, and leaves ref, page, per_page, and max_pages completely unexplained, including no hint that branch is a name/ref string or what ref does.

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 states a specific verb and resource: "Retrieve information about a specific branch in a project." That is enough to separate it from create_branch/delete_branch by name and semantics, though it never explicitly contrasts itself with the sibling gitlab_get_branches (list) tool.

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_branches or gitlab_get_protected_branch, and no prerequisites beyond the implicit need for a project and branch. The only conditional information is the error case, not usage selection.

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