update_branch_protection
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.
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": {
"project": "<project>",
"branch": "<branch>"
},
"name": "update_branch_protection"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| branch | Yes | ||
| target | No | ||
| dry_run | No | ||
| project | Yes | ||
| protect | No | ||
| allow_force_push | No |