Skip to main content
Glama

update_branch_protection

Destructive

Protect or unprotect a Git branch by recording current settings for reversible undo. Use dry_run to preview changes and allow_force_push to set force-push policy.

Instructions

[WRITE][risk=medium] Protect/unprotect a branch; reversible.

Reads the branch's current protection first so the harness records an undo that replays this same tool with the prior settings. Pass dry_run=True to preview.

Args: project: Project id or full path. branch: Branch name (from list_branches). protect: True to protect the branch, False to remove protection. allow_force_push: Whether the protection permits force-push (default False — the safe setting). dry_run: If True, preview without changing. target: Server target name from config; omit for the default.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
branchYes
targetNo
dry_runNo
projectYes
protectNo
allow_force_pushNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.5.0

TDQS

A4.4/5.0
Behavior5/5

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

Beyond the annotations (readOnlyHint=false, destructiveHint=true, idempotentHint=false), the description discloses the read-before-write pattern, that an undo record is captured, that the undo replays this same tool with prior settings, and that dry_run offers a preview. This is unusually rich behavioral context.

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?

The leading tag line is dense and front-loaded, and the Args block is well organized. The undo/read-first explanation is slightly verbose but each sentence adds real value, so waste is minimal.

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 six-parameter mutation tool with no output schema, the description covers the mechanics (read-first, undo, dry-run) and every parameter. Only minor gaps remain, such as whether a success response or returned undo handle needs to be inspected.

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

Parameters5/5

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

Schema description coverage is 0%, so the description must carry the full burden — and it does, documenting all six parameters in prose: project (id or full path), branch (from list_branches), protect, allow_force_push (safe default), dry_run, and target (config target name). It fully compensates for the schema gap.

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 opens with a specific verb and resource: 'Protect/unprotect a branch'. It also explicitly distinguishes the operation's nature via '[WRITE][risk=medium]' and 'reversible', letting an agent separate it from read-only siblings like list_protected_branches or list_branches.

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?

It gives a clear condition for previewing ('Pass dry_run=True to preview') and notes the safe default for allow_force_push, but it never states when to choose this tool over alternatives (e.g., when to use list_protected_branches first) or explicit when-not-to-use guidance.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.