Skip to main content
Glama
Lexmata

Bitbucket Cloud MCP Server

by Lexmata

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
NameRequiredDescriptionDefault
workspaceYesThe workspace slug
repo_slugYesThe repository slug
branch_nameYesThe branch name

Implementation Reference

  • 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)}` ); }
  • 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); }
  • 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'), }),
  • 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'], }, },

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Lexmata/bitbucket-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server