get_branch
Retrieve details of a specific branch including its latest commit from a Bitbucket Cloud repository to track changes and monitor development progress.
Instructions
Get details of a specific branch including its latest commit.
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/api/branches.ts:26-30 (handler)Core handler function in BranchesAPI that fetches the specific branch details from Bitbucket API using GET request.async get(workspace: string, repo_slug: string, branch_name: string): Promise<BitbucketBranch> { return this.client.get<BitbucketBranch>( `/repositories/${workspace}/${repo_slug}/refs/branches/${encodeURIComponent(branch_name)}` ); }
- src/tools/index.ts:992-995 (handler)Tool dispatch handler in ToolHandler.handleTool that parses arguments and delegates to BranchesAPI.get.case 'get_branch': { const params = toolSchemas.get_branch.parse(args); return this.branches.get(params.workspace, params.repo_slug, params.branch_name); }
- src/tools/index.ts:156-160 (schema)Zod schema definition for get_branch tool input validation in toolSchemas.get_branch: z.object({ workspace: z.string().describe('The workspace slug'), repo_slug: z.string().describe('The repository slug'), branch_name: z.string().describe('The branch name'), }),
- src/tools/index.ts:586-598 (registration)Tool registration in toolDefinitions array, including name, description, and JSON schema for MCP.{ name: 'get_branch', description: 'Get details of a specific branch including its latest commit.', inputSchema: { type: 'object' as const, properties: { workspace: { type: 'string', description: 'The workspace slug' }, repo_slug: { type: 'string', description: 'The repository slug' }, branch_name: { type: 'string', description: 'The branch name' }, }, required: ['workspace', 'repo_slug', 'branch_name'], }, },