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'],
      },
    },
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool retrieves details and latest commit, implying a read-only operation, but doesn't specify authentication needs, rate limits, error conditions, or response format. For a tool with zero annotation coverage, this leaves significant behavioral gaps, though it correctly implies non-destructive behavior.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that front-loads the core purpose ('Get details of a specific branch') and adds a useful detail ('including its latest commit'). There's no wasted language, repetition, or unnecessary elaboration—every word earns its place in conveying essential information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's moderate complexity (3 required parameters, no output schema, no annotations), the description is minimally adequate. It covers the basic purpose but lacks usage guidelines, behavioral details, and output information. Without annotations or output schema, the agent must infer behavior from the description alone, which is incomplete for reliable tool invocation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, with all three parameters clearly documented in the schema. The description doesn't add any parameter-specific details beyond what the schema provides, such as explaining how 'branch_name' interacts with 'latest commit' or format examples. With high schema coverage, the baseline is 3, and the description doesn't compensate with extra semantic value.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose with a specific verb ('Get details') and resource ('a specific branch'), including what information is retrieved ('including its latest commit'). It distinguishes from sibling tools like 'list_branches' (which lists multiple branches) and 'get_commit' (which focuses on commits rather than branches). However, it doesn't explicitly contrast with all siblings, keeping it at a 4 rather than 5.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention when to choose 'get_branch' over 'list_branches' for branch information, or how it relates to 'get_commit' for commit details. There are no explicit when/when-not instructions or named alternatives, leaving usage entirely implied from the purpose statement.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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