protect_branch
Set branch protection rules in a GitLab project by configuring push and merge access levels, force push permissions, and code owner approval requirements.
Instructions
Protect a branch in a GitLab project
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "protect_branch"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | No | Branch name or wildcard | |
| project_id | No | Project ID or URL-encoded path | |
| allow_force_push | No | Allow force push | |
| push_access_level | No | Access level for push (0=No one, 30=Developers, 40=Maintainers) | |
| merge_access_level | No | Access level for merge | |
| code_owner_approval_required | No | Require code owner approval |