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
| Name | Required | Description | Default |
|---|---|---|---|
| workspace | Yes | The workspace slug | |
| repo_slug | Yes | The repository slug | |
| commit_hash | Yes | The commit hash |
Implementation Reference
- src/tools/index.ts:1015-1023 (handler)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 }; }
- src/api/commits.ts:47-49 (helper)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}`); }
- src/tools/index.ts:192-196 (schema)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'), }),
- src/tools/index.ts:659-671 (registration)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'], }, },