gitlab_list_branches
List GitLab project branches with optional substring filtering, returning default, protected, and merged flags plus tip commit ID, title, and date for branch review or selection.
Instructions
List branches of a project, optionally filtered by substring.
Includes default, protected and merged flags, and the short id
of the tip commit with its title and date.
Examples:
- "List all branches with 'release' in name" → search='release'
- "Next page of branches" → page=2
- Don't use when you want to check if a specific branch exists by exact name —
use gitlab_get_file on that ref and look at the error instead.
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_path": "<project_path>"
},
"name": "gitlab_list_branches"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| page | No | 1-based page number. | |
| search | No | Substring match on branch name (case-insensitive). | |
| per_page | No | Items per page (1–100). | |
| project_path | Yes | GitLab project path (e.g. 'my-org/my-repo'). Required by default. For legacy deployments only, set GITLAB_ALLOW_DEFAULT_PROJECT=true to use GITLAB_PROJECT_PATH when omitted. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| count | Yes | ||
| project | Yes | ||
| branches | Yes | ||
| pagination | Yes |