Skip to main content
Glama
Lexmata

Bitbucket Cloud MCP Server

by Lexmata

get_branch

Retrieve details of a specific branch, including its latest commit information, from a Bitbucket Cloud repository.

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

  • The handler case in ToolHandler.handleTool that parses arguments using the tool schema and calls BranchesAPI.get to retrieve the branch details.
    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 validating the input parameters of the get_branch tool.
    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 the toolDefinitions array, providing name, description, and JSON input schema for MCP protocol.
    { 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'], }, },
  • Supporting method in BranchesAPI that performs the actual Bitbucket API GET request to fetch the specific branch details.
    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)}` ); }

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