Skip to main content
Glama
Lexmata

Bitbucket Cloud MCP Server

by Lexmata

list_commits

Retrieve commit history from a Bitbucket Cloud repository with branch filtering and pagination options to track code changes.

Instructions

List commits in a repository with optional filtering by branch.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
workspaceYesThe workspace slug
repo_slugYesThe repository slug
branchNoBranch name to filter commits
includeNoCommit to include
excludeNoCommit to exclude
pageNoPage number
pagelenNoResults per page

Implementation Reference

  • Handler logic in ToolHandler.handleTool method: parses arguments using the schema and delegates to CommitsAPI.list
    case 'list_commits': {
      const params = toolSchemas.list_commits.parse(args);
      return this.commits.list(params);
    }
  • Tool registration in toolDefinitions array, including name, description, and input schema definition
    {
      name: 'list_commits',
      description: 'List commits in a repository with optional filtering by branch.',
      inputSchema: {
        type: 'object' as const,
        properties: {
          workspace: { type: 'string', description: 'The workspace slug' },
          repo_slug: { type: 'string', description: 'The repository slug' },
          branch: { type: 'string', description: 'Branch name to filter commits' },
          include: { type: 'string', description: 'Commit to include' },
          exclude: { type: 'string', description: 'Commit to exclude' },
          page: { type: 'number', description: 'Page number' },
          pagelen: { type: 'number', description: 'Results per page' },
        },
        required: ['workspace', 'repo_slug'],
      },
    },
  • Zod schema definition for list_commits tool input validation
    list_commits: z.object({
      workspace: z.string().describe('The workspace slug'),
      repo_slug: z.string().describe('The repository slug'),
      branch: z.string().optional().describe('Branch name to filter commits'),
      include: z.string().optional().describe('Commit to include'),
      exclude: z.string().optional().describe('Commit to exclude'),
      page: z.number().optional().describe('Page number'),
      pagelen: z.number().optional().describe('Results per page'),
    }),
  • Core implementation in CommitsAPI.list: constructs query parameters and makes API call to list commits
    async list(params: ListCommitsParams): Promise<PaginatedResponse<BitbucketCommit>> {
      const { workspace, repo_slug, branch, include, exclude, ...queryParams } = params;
    
      // Build query params
      const allParams: Record<string, string | number | undefined> = {
        ...queryParams,
      };
    
      // For branch filtering, use the include parameter
      if (branch) {
        allParams.include = branch;
      } else if (include) {
        allParams.include = include;
      }
    
      if (exclude) {
        allParams.exclude = exclude;
      }
    
      return this.client.get<PaginatedResponse<BitbucketCommit>>(
        `/repositories/${workspace}/${repo_slug}/commits`,
        allParams
      );
    }
  • TypeScript interface defining the parameters for listing commits
    export interface ListCommitsParams {
      workspace: string;
      repo_slug: string;
      branch?: string;
      include?: string;
      exclude?: string;
      page?: number;
      pagelen?: number;
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the tool lists commits with optional filtering, but doesn't describe what the output looks like (e.g., commit metadata format), whether it's paginated (though 'page' and 'pagelen' parameters hint at this), rate limits, authentication requirements, or error conditions. This leaves significant gaps for an agent to understand the tool's behavior.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that states the core purpose upfront with no wasted words. It's appropriately sized for a list operation and gets straight to the point without unnecessary elaboration.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a tool with 7 parameters, no annotations, and no output schema, the description is insufficient. It doesn't explain the return format, pagination behavior (implied by parameters but not stated), error handling, or how filtering works beyond branch. Given the complexity and lack of structured data, more contextual information would be needed for an agent to use this tool effectively.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents all 7 parameters thoroughly. The description adds minimal value by mentioning optional filtering by branch, which aligns with the 'branch' parameter but doesn't provide additional context beyond what's in the schema. This meets the baseline for high schema coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb ('List') and resource ('commits in a repository'), making the purpose immediately understandable. It distinguishes from some siblings like 'get_commit' (singular) but doesn't explicitly differentiate from other list operations like 'list_branches' or 'list_pull_requests' beyond the resource type.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description mentions optional filtering by branch, which provides some usage context, but offers no guidance on when to use this tool versus alternatives like 'get_commit' (for a single commit) or 'list_pull_requests' (which might contain commits). There's no mention of prerequisites, exclusions, or specific scenarios where this tool is preferred.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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