Skip to main content
Glama

Protect branch

protect_branch

Create a protected-branch policy by defining push/merge permissions and an unprotect rule, with explicit acknowledgment to prevent accidental lockout.

Instructions

Create protected-branch policy after a capability preflight. An explicit acknowledgement and unprotect rule are required to avoid accidental lockout.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYes
projectYesGitLab project ID or full path such as group/project.
allowed_to_pushNo
allow_force_pushNo
allowed_to_mergeNo
allowed_to_unprotectYes
code_owner_approval_requiredNo
acknowledge_protection_changeYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYesGitLab response normalized for model use.
Behavior4/5

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

Annotations already mark this as non-read-only and non-destructive, but the description adds important behavioral context: it warns about accidental lockout and requires explicit acknowledgement and an unprotect rule. This goes beyond the annotations and explains the safety mechanism.

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?

Two sentences, front-loaded with the action, and every phrase adds value. No filler or repetition of schema 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 description covers the essential safety and preflight context, and the output schema exists for return values. However, the large number of parameters and low schema coverage mean some parameter semantics are left ambiguous, but overall the description is adequate for a create operation with strong safety warnings.

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 low (13%), so the description should compensate. It clarifies the two critical required parameters (acknowledge_protection_change and allowed_to_unprotect) but leaves the remaining six parameters unspecified, relying on their names and schema types.

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?

The description begins with 'Create protected-branch policy,' which uses a specific verb and resource. It clearly distinguishes from siblings like update_protected_branch and unprotect_branch by indicating creation, and the scope is well-defined.

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?

The description states a clear prerequisite ('after a capability preflight') and notes that an acknowledgement and unprotect rule are required. It does not explicitly name alternatives, but the verb 'Create' implies when to use this tool versus update/delete/list operations.

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

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