Skip to main content
Glama
Lexmata

Bitbucket Cloud MCP Server

by Lexmata

get_commit_diff

Retrieve detailed changes for a specific commit in Bitbucket Cloud, showing all modifications made in that update.

Instructions

Get the diff for a specific commit showing all changes.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
workspaceYesThe workspace slug
repo_slugYesThe repository slug
commit_hashYesThe commit hash

Implementation Reference

  • The handler function within ToolHandler.handleTool that executes the get_commit_diff tool. It validates input using Zod schema and calls the CommitsAPI.getDiff method to fetch the commit diff.
    case 'get_commit_diff': {
      const params = toolSchemas.get_commit_diff.parse(args);
      const diff = await this.commits.getDiff(
        params.workspace,
        params.repo_slug,
        params.commit_hash
      );
      return { diff };
    }
  • The supporting utility in CommitsAPI that performs the actual Bitbucket API request to retrieve the raw diff for the specified commit.
    async getDiff(workspace: string, repo_slug: string, commit_hash: string): Promise<string> {
      return this.client.getRaw(`/repositories/${workspace}/${repo_slug}/diff/${commit_hash}`);
    }
  • Zod schema for input validation of the get_commit_diff tool parameters.
    get_commit_diff: z.object({
      workspace: z.string().describe('The workspace slug'),
      repo_slug: z.string().describe('The repository slug'),
      commit_hash: z.string().describe('The commit hash'),
    }),
  • Tool registration entry in the toolDefinitions array, including name, description, and JSON input schema for MCP protocol.
    {
      name: 'get_commit_diff',
      description: 'Get the diff for a specific commit showing all changes.',
      inputSchema: {
        type: 'object' as const,
        properties: {
          workspace: { type: 'string', description: 'The workspace slug' },
          repo_slug: { type: 'string', description: 'The repository slug' },
          commit_hash: { type: 'string', description: 'The commit hash' },
        },
        required: ['workspace', 'repo_slug', 'commit_hash'],
      },
    },
Behavior2/5

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

No annotations are provided, so the description carries full burden. It mentions 'showing all changes' which hints at output behavior, but lacks critical details like format (e.g., unified diff, patch), pagination, error conditions, or authentication needs for a read operation.

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?

Single sentence, front-loaded with the core purpose, no redundant words. Efficiently conveys the essential information without waste.

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?

For a tool with 3 parameters, no annotations, and no output schema, the description is insufficient. It lacks details on output format, error handling, or behavioral traits, leaving gaps for an AI agent to correctly interpret results.

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 schema. The description adds no additional parameter context beyond implying 'commit_hash' identifies the target, which the schema already covers. Baseline 3 is appropriate as the schema does the heavy lifting.

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 ('Get the diff') and resource ('for a specific commit'), specifying it shows 'all changes'. It distinguishes from sibling 'get_pr_diff' by focusing on commits rather than pull requests, but doesn't explicitly contrast them.

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?

No guidance on when to use this tool versus alternatives like 'get_pr_diff' or 'get_commit', nor any prerequisites or contextual constraints. The description only states what it does, not when it's appropriate.

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