Skip to main content
Glama

get_protected_branch

Read-only

Retrieve details for a single protected GitLab branch, including access levels and force push settings. Use this read-only tool when you have the project ID and branch name.

Instructions

Get details of a single protected branch (access levels, force push settings). Use this for a known resource or result; choose the corresponding list or search tool when you need to discover multiple resources. It is read-only and does not mutate GitLab data; missing resources, invalid identifiers, insufficient permission, and rate limits are returned as errors. When project_id or group_id is accepted, provide the numeric ID or complete URL-encoded path described by the schema; use required identifiers and pagination fields exactly as documented.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
jmespathNoOptional JMESPath expression filtering the JSON result before return.
project_idYesProject ID or complete URL-encoded path to project
branch_nameYesName of the protected branch

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv2.1.66
    • addedInput schema / properties / jmespath
      Added value: +{
      +  "description": "Optional JMESPath expression filtering the JSON result before return.",
      +  "type": "string"
      +}
  2. Changed1 schema field changedv2.1.62
    • changedInput schema / required
      Previous value: -[
      -  "branch_name",
      -  "project_id"
      -]New value: +[
      +  "project_id",
      +  "branch_name"
      +]
  3. Addedv2.1.21

TDQS

A4.1/5.0
Behavior4/5

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

Beyond the annotations (readOnlyHint=true, openWorldHint=true), the description discloses concrete error semantics: missing resources, invalid identifiers, insufficient permission, and rate limits are returned as errors. This adds genuine behavioral context an agent cannot infer from the annotations alone; nothing contradicts them.

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

Conciseness4/5

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

Three sentences, front-loaded with the core purpose and followed by usage and error guidance. Minor template residue ('When project_id or group_id is accepted' mentions group_id, which is not a parameter here; 'pagination fields' is irrelevant) keeps it from being perfectly lean, but overall it is compact and well ordered.

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?

For a simple 3-parameter read tool with strong annotations and full schema coverage, the description covers purpose, when to use it, error behavior, and identifier formatting. The main gap is the absence of any return-shape guidance given there is no output schema, but the purpose sentence names the key result fields (access levels, force push settings).

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?

Schema description coverage is 100%, so the baseline is 3. The description largely restates what the schema already says about project_id (numeric ID or URL-encoded path) rather than adding new meaning; the generic instruction about 'pagination fields' doesn't apply since this tool has no pagination parameters.

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?

States a specific verb and resource: 'Get details of a single protected branch (access levels, force push settings).' It also distinguishes itself from siblings by scoping to a single known resource versus discovery-oriented list/search tools, so an agent can tell it apart from list_protected_branches immediately.

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

Usage Guidelines4/5

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

Gives explicit when-to-use ('known resource or result') and when-not-to-use ('need to discover multiple resources') guidance, which is clear and actionable. The alternative is pointed to generically as 'the corresponding list or search tool' rather than named (e.g., list_protected_branches), so it stops just short of a 5.

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