Skip to main content
Glama
jlromano

Bitbucket MCP Server

by jlromano

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
NameRequiredDescriptionDefault
workspaceYesThe workspace slug
repo_slugYesThe repository slug
branchNoFilter commits by branch (optional)

Implementation Reference

  • 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'],
      },
    },
  • 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),
          },
        ],
      };
    }

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/jlromano/bitbucket-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server