list_branches
Lists Git repository branches with prefix or substring filters, author scope, commit statuses, pagination, and ahead/behind statistics to find and compare branches before merging or reviewing.
Instructions
List branches in a Git repository with optional prefix/substring filters, includeMyBranches, commit statuses, continuation-token pagination, and ahead/behind branch statistics
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": {
"repositoryId": "<repositoryId>"
},
"name": "list_branches"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| top | No | Maximum number of branches to return per page (1–1000; supported on Azure DevOps Services and Server 2020+) | |
| filter | No | Optional branch name prefix filter (e.g., "feature/" or "heads/feature/"). Automatically scoped to heads/. Cannot be combined with includeMyBranches: true. | |
| projectId | No | The ID or name of the project (defaults to AZURE_DEVOPS_DEFAULT_PROJECT) | |
| includeStats | No | Enrich branches with aheadCount, behindCount, isBaseVersion, and tip commit from stats/branches | |
| repositoryId | Yes | The ID or name of the repository | |
| filterContains | No | Optional substring filter for branch names | |
| organizationId | No | The ID or name of the organization (defaults to configured organization) | |
| includeStatuses | No | Include Git commit statuses on each branch | |
| continuationToken | No | Continuation token from a previous list_branches response (supported on Azure DevOps Services and Server 2020+) | |
| includeMyBranches | No | Return only branches created by the authenticated caller. Cannot be combined with filter. | |
| latestStatusesOnly | No | Return only the latest status per context (requires includeStatuses: true) |