Skip to main content
Glama

Get protected branch

gitlab_get_protected_branch
Read-onlyIdempotent

Fetches information about a specific protected branch in a GitLab project by project ID and branch name, helping you verify branch protection settings and access rules.

Instructions

Get information about a specific protected branch in a project.

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

Returns: Response: A wrapper containing the original response and 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_protected_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

B3/5.0
Behavior3/5

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

Annotations already declare readOnlyHint, idempotentHint and destructiveHint=false, so safety is covered externally. The description does add value by naming the error conditions (MissingParameterError, ParameterError) and the return shape (a wrapper with a Branch model), but omits anything about pagination behavior despite exposing page/per_page/max_pages parameters.

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

Conciseness3/5

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

The opening sentence is well front-loaded, and the Raises/Returns sections are useful. However, the Args section is boilerplate copied from a docstring generator, describes a **kwargs bag that does not match the actual schema, and thus wastes the reader's attention.

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

Completeness2/5

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

With six parameters at 0% schema coverage, no output schema, and no documented pagination semantics, this description leaves significant gaps an agent must guess at. Naming the return type and error cases helps, but the parameter surface is essentially undocumented.

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%, so the description carries the full burden, and it only names two of six parameters (project_id, branch). It says nothing about ref, page, per_page, or max_pages, and the generic '**kwargs: Additional parameters for the request' signature is misleading for a schema with additionalProperties=false.

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 first sentence names a specific verb and resource ('Get information about a specific protected branch in a project'), which is clear enough for an agent to select it. It does not, however, distinguish itself from the obvious sibling gitlab_get_protected_branches, so the singular-vs-list choice is left implicit.

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

Usage Guidelines3/5

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

Usage context is only implied: the Raises section reveals that project_id and branch are effectively required, which hints at the call pattern. There is no explicit statement of when to prefer this over gitlab_get_protected_branches, gitlab_get_protected_tag, or gitlab_get_protected_environment.

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