list_commits
Retrieve commit history from a Bitbucket repository to track changes, review code updates, and analyze development progress.
Instructions
List commits in a repository
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| workspace | Yes | The workspace slug | |
| repo_slug | Yes | The repository slug | |
| branch | No | Filter commits by branch (optional) |
Implementation Reference
- src/BitbucketClient.ts:182-186 (handler)Implementation of listCommits in the Bitbucket client class.
async listCommits(workspace: string, repoSlug: string, branch?: string): Promise<Commit[]> { const params = branch ? { branch } : {}; const response = await this.api.get(`/repositories/${workspace}/${repoSlug}/commits`, { params }); return response.data.values; } - src/index.ts:273-294 (registration)Registration of the list_commits tool definition.
{ name: 'list_commits', description: 'List commits in a repository', inputSchema: { type: 'object', properties: { workspace: { type: 'string', description: 'The workspace slug', }, repo_slug: { type: 'string', description: 'The repository slug', }, branch: { type: 'string', description: 'Filter commits by branch (optional)', }, }, required: ['workspace', 'repo_slug'], }, }, - src/index.ts:581-596 (handler)Handler case in the server to invoke listCommits.
case 'list_commits': { const { workspace, repo_slug, branch } = args as { workspace: string; repo_slug: string; branch?: string; }; const commits = await client.listCommits(workspace, repo_slug, branch); return { content: [ { type: 'text', text: JSON.stringify(commits, null, 2), }, ], }; }