Skip to main content
Glama
jlromano

Bitbucket MCP Server

by jlromano

list_branches

Retrieve all branches in a Bitbucket repository by specifying workspace and repository slugs to view available branches for development or review.

Instructions

List all branches in a repository

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
workspaceYesThe workspace slug
repo_slugYesThe repository slug

Implementation Reference

  • Actual implementation of listing branches via Bitbucket API.
    async listBranches(workspace: string, repoSlug: string): Promise<Branch[]> {
      const response = await this.api.get(`/repositories/${workspace}/${repoSlug}/refs/branches`);
      return response.data.values;
    }
  • src/index.ts:84-96 (registration)
    Tool registration definition for 'list_branches'.
    {
      name: 'list_branches',
      description: 'List all branches in a repository',
      inputSchema: {
        type: 'object',
        properties: {
          workspace: {
            type: 'string',
            description: 'The workspace slug',
          },
          repo_slug: {
            type: 'string',
            description: 'The repository slug',
  • Tool handler logic in index.ts that calls the BitbucketClient.
    case 'list_branches': {
      const { workspace, repo_slug } = args as { workspace: string; repo_slug: string };
      const branches = await client.listBranches(workspace, repo_slug);
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify(branches, null, 2),
          },
        ],
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the basic function but lacks critical details: whether this is a read-only operation, if it requires authentication, what the return format looks like (e.g., list of branch names with metadata), or if there are pagination or rate limits. This leaves significant gaps for an agent.

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 with zero waste. It's front-loaded with the core purpose and appropriately sized for a simple list operation, making it easy for an agent to parse quickly.

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

Completeness2/5

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

Given the lack of annotations and output schema, the description is incomplete. It doesn't explain what the tool returns (e.g., a list of branch objects with names, commits, etc.), which is crucial for a list operation. For a tool with 2 parameters and no structured output, more context is needed to be fully helpful.

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?

The schema description coverage is 100%, with both parameters ('workspace' and 'repo_slug') clearly documented in the schema. The description doesn't add any meaning beyond what the schema provides, such as explaining how these slugs are formatted or where to find them, but this is acceptable given the high schema coverage.

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 action ('List all branches') and the resource ('in a repository'), providing a specific verb+resource combination. However, it doesn't differentiate from sibling tools like 'get_branch' or 'compare_branches', which prevents a perfect score.

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 'list_branches' over 'get_branch' (for a single branch) or 'compare_branches' (for branch differences), nor does it specify any prerequisites or exclusions.

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/jlromano/bitbucket-mcp'

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