get_branch
Retrieve detailed information about a specific branch in a Bitbucket repository, including its commit history and metadata, to support repository management and development workflows.
Instructions
Get details of a specific branch
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| workspace | Yes | The workspace slug | |
| repo_slug | Yes | The repository slug | |
| branch_name | Yes | The branch name |
Implementation Reference
- src/BitbucketClient.ts:124-127 (handler)The actual implementation of the getBranch method, which makes the API call to fetch branch details.
async getBranch(workspace: string, repoSlug: string, branchName: string): Promise<Branch> { const response = await this.api.get(`/repositories/${workspace}/${repoSlug}/refs/branches/${branchName}`); return response.data; } - src/index.ts:451-465 (handler)The handler logic in index.ts that processes the 'get_branch' tool call by calling the BitbucketClient.
case 'get_branch': { const { workspace, repo_slug, branch_name } = args as { workspace: string; repo_slug: string; branch_name: string; }; const branch = await client.getBranch(workspace, repo_slug, branch_name); return { content: [ { type: 'text', text: JSON.stringify(branch, null, 2), }, ], }; - src/index.ts:102-119 (registration)The registration of the 'get_branch' tool, including its schema and description.
{ name: 'get_branch', description: 'Get details of a specific branch', inputSchema: { type: 'object', properties: { workspace: { type: 'string', description: 'The workspace slug', }, repo_slug: { type: 'string', description: 'The repository slug', }, branch_name: { type: 'string', description: 'The branch name', },