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

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