Skip to main content
Glama
jlromano

Bitbucket MCP Server

by jlromano

compare_branches

Compare two branches in a Bitbucket repository to identify differences in code, commits, or changes before merging or reviewing.

Instructions

Compare two branches

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
workspaceYesThe workspace slug
repo_slugYesThe repository slug
source_branchYesThe source branch
destination_branchYesThe destination branch

Implementation Reference

  • The actual implementation of the compareBranches logic.
    async compareBranches(
      workspace: string,
      repoSlug: string,
      sourceBranch: string,
      destinationBranch: string
    ): Promise<any> {
      const response = await this.api.get(`/repositories/${workspace}/${repoSlug}/diff/${sourceBranch}..${destinationBranch}`);
      return response.data;
    }
  • The registration and input schema for the compare_branches tool.
    {
      name: 'compare_branches',
      description: 'Compare two branches',
      inputSchema: {
        type: 'object',
        properties: {
          workspace: {
            type: 'string',
            description: 'The workspace slug',
          },
          repo_slug: {
            type: 'string',
            description: 'The repository slug',
          },
          source_branch: {
            type: 'string',
            description: 'The source branch',
          },
          destination_branch: {
            type: 'string',
            description: 'The destination branch',
          },
        },
        required: ['workspace', 'repo_slug', 'source_branch', 'destination_branch'],
      },
  • The tool handler in index.ts that calls the BitbucketClient.
    case 'compare_branches': {
      const { workspace, repo_slug, source_branch, destination_branch } = args as {
        workspace: string;
        repo_slug: string;
        source_branch: string;
        destination_branch: string;
      };
      const diff = await client.compareBranches(workspace, repo_slug, source_branch, destination_branch);
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify(diff, null, 2),
          },
        ],
      };
    }
    
    default:
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 action ('compare') but doesn't describe what the comparison entails (e.g., output format, whether it's read-only, potential side effects, or error conditions). This leaves significant gaps in understanding how the tool behaves beyond its basic function.

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 extremely concise with 'Compare two branches', a single phrase that front-loads the core purpose without unnecessary words. Every part earns its place, making it efficient and easy to parse, though it may be overly brief for completeness.

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 complexity of a comparison tool with 4 parameters, no annotations, and no output schema, the description is incomplete. It doesn't explain what the comparison returns (e.g., diff, commit list), behavioral traits, or how it fits with sibling tools. This leaves the agent with insufficient context to use the tool effectively beyond basic 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 clear parameter descriptions in the input schema (e.g., 'workspace slug', 'repository slug'). The tool description adds no additional meaning beyond the schema, such as explaining relationships between parameters or usage examples. This meets the baseline for high schema coverage but doesn't enhance parameter understanding.

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

Purpose3/5

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

The description 'Compare two branches' clearly states the verb (compare) and resource (branches), making the purpose understandable. However, it lacks specificity about what aspects are compared (e.g., commits, files, diffs) and doesn't distinguish it from sibling tools like 'get_branch' or 'list_commits', which might provide related information. This makes it vague but not misleading.

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 prerequisites (e.g., needing a workspace or repository context), exclusions, or how it relates to sibling tools like 'get_commit' or 'list_commits' for similar comparisons. Usage is implied only by the tool name, with no explicit instructions.

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