Skip to main content
Glama

protect_branch

Destructive

Set push, merge, and unprotect access levels for a branch, optionally allow force push or require code owner approval.

Instructions

Protect a repository branch (set push/merge/unprotect access levels)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
project_idNoProject ID or complete URL-encoded path to project
branch_nameYesBranch name or wildcard pattern to protect
nameNoDeprecated alias for branch_name; prefer branch_name for consistency
push_access_levelNoAccess level for pushing (0=No access, 30=Developer, 40=Maintainer, 60=Admin). GitLab default applies when omitted.
merge_access_levelNoAccess level for merging (0=No access, 30=Developer, 40=Maintainer, 60=Admin). GitLab default applies when omitted.
unprotect_access_levelNoAccess level for unprotecting (0=No access, 30=Developer, 40=Maintainer, 60=Admin). GitLab default applies when omitted.
allow_force_pushNoAllow force push to the protected branch. Default: false
code_owner_approval_requiredNoRequire code owner approval before merging (PREMIUM). Default: false
Behavior3/5

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

Annotations already declare destructiveHint=true and openWorldHint=true, indicating modification and side effects. Description adds that it sets access levels, but beyond that, no disclosing of idempotency, handling of existing protection, or other behavioral traits. The description provides marginal added value over annotations.

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?

Single, front-loaded sentence with no superfluous words. Every word is relevant to the tool's core function.

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?

Despite 8 parameters and no output schema, the description provides minimal context. It doesn't explain access level values, what happens when omitted, or any best practices. The schema covers parameter descriptions, but overall context for a complex tool is lacking.

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 coverage is 100%, so baseline is 3. Description only echoes what parameters imply ('push/merge/unprotect access levels') without adding new meaning or clarifying values, defaults, or relationships.

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?

Description clearly states the verb 'Protect' and the resource 'repository branch', specifying the settings: push, merge, unprotect access levels. It distinguishes from siblings like unprotect_branch (opposite) and delete_branch (deletion).

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?

No guidance on when to use this tool vs alternatives (e.g., unprotect_branch, get_protected_branch). No prerequisites mentioned (e.g., branch must exist), nor any scenarios where this tool should not be used.

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/zereight/gitlab-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server