Skip to main content
Glama
Lexmata

Bitbucket Cloud MCP Server

by Lexmata

get_commit_diff

Retrieve the detailed changes for a specific commit in a Bitbucket Cloud repository to review modifications and understand code evolution.

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

  • Handler case in ToolHandler.handleTool method that parses arguments with Zod schema and calls CommitsAPI.getDiff to retrieve and return 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 }; }
  • Zod schema defining the input parameters for the get_commit_diff tool: workspace, repo_slug, and commit_hash.
    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'), }),
  • MCP tool definition registration in toolDefinitions array, including name, description, and JSON schema for inputs.
    { 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'], }, },
  • Helper method in CommitsAPI class that makes a raw GET request to Bitbucket's commit diff API endpoint.
    async getDiff(workspace: string, repo_slug: string, commit_hash: string): Promise<string> { return this.client.getRaw(`/repositories/${workspace}/${repo_slug}/diff/${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