get_commit
Retrieve commit details like message, author, and parent commits from a Bitbucket Cloud repository to analyze 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/tools/index.ts:1011-1014 (handler)The handler for the 'get_commit' tool. Parses input parameters using the Zod schema and calls the CommitsAPI.get method to fetch commit details from Bitbucket.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 schema definition for validating input parameters of the get_commit tool: workspace, repo_slug, and commit_hash.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)MCP tool registration for 'get_commit', including name, description, and input schema for the Model Context Protocol.{ 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'], },
- src/api/commits.ts:38-42 (helper)Core implementation of fetching a specific commit via Bitbucket API GET request to /repositories/{workspace}/{repo_slug}/commit/{commit_hash}.async get(workspace: string, repo_slug: string, commit_hash: string): Promise<BitbucketCommit> { return this.client.get<BitbucketCommit>( `/repositories/${workspace}/${repo_slug}/commit/${commit_hash}` ); }