Skip to main content
Glama
Lexmata

Bitbucket Cloud MCP Server

by Lexmata

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
NameRequiredDescriptionDefault
workspaceYesThe workspace slug
repo_slugYesThe repository slug
commit_hashYesThe commit hash

Implementation Reference

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

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

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