Skip to main content
Glama

Update Protected Branch

gitlab_update_protected_branch

Update an existing GitLab protected branch rule to change force push, code owner approval, and allowed push, merge, or unprotect entries; add, modify, or remove access entries safely.

Instructions

Change an existing branch protection rule in place: allow_force_push, code_owner_approval_required, and allowed_to_push/allowed_to_merge/allowed_to_unprotect entries. Add an entry with one of access_level, user_id, group_id, or deploy_key_id (push only); change one with its id; remove one with {id, _destroy: true}. Read entry ids with gitlab_get_protected_branch. Changes that would leave nobody allowed to unprotect are refused.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "branch": "<branch>"
    },
    "name": "gitlab_update_protected_branch"
  }
}

Input Schema

NameRequiredDescriptionDefault
branchYes
project_idNo
allowed_to_pushNo
allow_force_pushNo
allowed_to_mergeNo
allowed_to_unprotectNo
code_owner_approval_requiredNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv1.7.0

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already say this is a non-read-only, non-idempotent, non-destructive mutation, so the description's added value is the in-place partial-update semantics: entries are individually added, modified, or destroyed rather than the whole list being replaced. The refusal rule ('Changes that would leave nobody allowed to unprotect are refused') is a valuable server-side constraint not derivable from annotations. Permission requirements and the response shape are still unstated.

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, no filler, with the core mutation scope front-loaded before the entry-manipulation rules. The middle sentence is dense and packs three operations into one line, but every clause carries distinct information.

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

Completeness5/5

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

For a 7-parameter mutation tool with no output schema and zero schema descriptions, the definition covers the hard parts: nested entry add/update/delete semantics, the actionable refusal constraint, and where to fetch ids. The only omission is target identification (branch/project_id), which the schema's required field makes reasonably discoverable.

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

Parameters4/5

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

Schema description coverage is 0% across 7 parameters, so the description must carry the load, and it largely does: it names which parameters are editable, the four mutually exclusive entry key types, the push-only restriction on deploy_key_id, and the _destroy removal flag. The gaps are the required `branch` and `project_id` parameters, which are never mentioned, so an agent gets no help on identifying the target rule.

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 opening clause states a specific verb and resource ('Change an existing branch protection rule in place') and immediately enumerates the mutable fields. That distinguishes it clearly from gitlab_protect_branch (creation), gitlab_unprotect_branch (removal of the rule), and gitlab_get_protected_branch (read).

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 operating guidance for the three nested-array parameters: add with access_level/user_id/group_id/deploy_key_id, change with id, remove with {id, _destroy: true}. It also routes the agent to gitlab_get_protected_branch to obtain entry ids, which is a genuine alternative-tool pointer. It does not state when to prefer gitlab_protect_branch or gitlab_unprotect_branch instead, so it stops short of full when/when-not coverage.

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