list_branches
Retrieve all branches in a Bitbucket repository by specifying workspace and repository slugs to view available branches for development or review.
Instructions
List all branches in a repository
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| workspace | Yes | The workspace slug | |
| repo_slug | Yes | The repository slug |
Implementation Reference
- src/BitbucketClient.ts:119-122 (handler)Actual implementation of listing branches via Bitbucket API.
async listBranches(workspace: string, repoSlug: string): Promise<Branch[]> { const response = await this.api.get(`/repositories/${workspace}/${repoSlug}/refs/branches`); return response.data.values; } - src/index.ts:84-96 (registration)Tool registration definition for 'list_branches'.
{ name: 'list_branches', description: 'List all branches in a repository', inputSchema: { type: 'object', properties: { workspace: { type: 'string', description: 'The workspace slug', }, repo_slug: { type: 'string', description: 'The repository slug', - src/index.ts:438-447 (handler)Tool handler logic in index.ts that calls the BitbucketClient.
case 'list_branches': { const { workspace, repo_slug } = args as { workspace: string; repo_slug: string }; const branches = await client.listBranches(workspace, repo_slug); return { content: [ { type: 'text', text: JSON.stringify(branches, null, 2), }, ],