get_commit
Retrieve commit details including message, author, and parent commits from Bitbucket Cloud repositories to analyze code changes and track development history.
Instructions
Get details of a specific commit including its message, author, and parent commits.
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/api/commits.ts:38-42 (handler)Core handler implementation: fetches the specific commit details from the Bitbucket API endpoint using the client.async get(workspace: string, repo_slug: string, commit_hash: string): Promise<BitbucketCommit> { return this.client.get<BitbucketCommit>( `/repositories/${workspace}/${repo_slug}/commit/${commit_hash}` ); }
- src/tools/index.ts:1009-1012 (handler)MCP tool handler switch case: validates arguments with schema and delegates to CommitsAPI.get method.case 'get_commit': { const params = toolSchemas.get_commit.parse(args); return this.commits.get(params.workspace, params.repo_slug, params.commit_hash); }
- src/tools/index.ts:186-190 (schema)Zod input schema definition for the get_commit tool parameters.get_commit: 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:645-657 (registration)Tool registration in the MCP toolDefinitions array, defining name, description, and JSON schema for inputs.{ name: 'get_commit', description: 'Get details of a specific commit including its message, author, and parent commits.', 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'], },