Skip to main content
Glama
RajuSudhar

Atlassian Bitbucket MCP Server

by RajuSudhar

bitbucket_search_commits

Find commits by searching their messages in a Bitbucket repository. Specify project key, repo slug, and query to retrieve matching commits.

Instructions

Search commits by message

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
projectYesProject key
repoYesRepository slug
queryYesSearch query
limitNoMax results
startNoPagination start

Implementation Reference

  • Handler function for bitbucket_search_commits tool. Parses input args with searchCommitsShape, requires 'search_code' permission, calls searchApi.searchCommits(), and returns text result or error.
    bitbucket_search_commits: async (args: unknown): Promise<McpToolResult> => {
      const start = Date.now();
      try {
        const input = z.object(searchCommitsShape).parse(args);
        requirePermission(config, 'search_code');
        log('info', 'tool start', {
          operation: 'tool_execute',
          toolName: 'bitbucket_search_commits',
        });
        const result = await searchApi.searchCommits(
          input.project,
          input.repo,
          input.query,
          input.limit,
          input.start
        );
        log('info', 'tool end', {
          toolName: 'bitbucket_search_commits',
          durationMs: Date.now() - start,
        });
        return textResult(result);
      } catch (err) {
        log('error', 'tool error', {
          toolName: 'bitbucket_search_commits',
          error: String(err),
          durationMs: Date.now() - start,
        });
        return errorResult(
          'SEARCH_COMMITS_FAILED',
          err instanceof Error ? err.message : String(err)
        );
      }
    },
  • Input schema definition for searchCommitsShape: includes project, repo (from repoRefShape), query (string 1-500 chars), limit, and start.
    export const searchCommitsShape = {
      ...repoRefShape,
      query: z.string().min(1).max(500).describe('Search query'),
      limit,
      start,
    } as const;
  • Tool registration entry mapping name 'bitbucket_search_commits' to description, searchCommitsShape schema, and handler h.search.bitbucket_search_commits.
    {
      name: 'bitbucket_search_commits',
      description: 'Search commits by message',
      shape: searchCommitsShape,
      handler: h.search.bitbucket_search_commits,
    },
  • SearchApi.searchCommits() method that makes HTTP GET request to /projects/{project}/repos/{repo}/commits with query, limit, start parameters.
      async searchCommits(
        project: string,
        repo: string,
        query: string,
        limit = 25,
        start = 0
      ): Promise<BitbucketPagedResponse<{ readonly id: string; readonly message: string }>> {
        return this.client.requestJson(`/projects/${project}/repos/${repo}/commits`, {
          queryParams: { query, limit, start },
        });
      }
    }
Behavior2/5

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

Description provides no behavioral traits (e.g., pagination, ordering, performance) beyond the bare action. With no annotations, the description should disclose more, such as the fact that pagination parameters exist or that results are limited to commits matching a message string.

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

Conciseness4/5

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

The description is extremely concise at four words, front-loading the key purpose. While efficient, it sacrifices potentially useful detail that could improve clarity.

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?

Given 5 parameters, no output schema, and no annotations, the description is insufficient. It fails to explain the result format, pagination behavior, or query syntax, leaving the agent with incomplete information for effective use.

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 coverage is 100% with descriptions for each parameter, so the description does not need to add parameter details. However, it misses the opportunity to clarify how the 'query' parameter is interpreted (e.g., exact match, substring), which is not obvious from the parameter description alone.

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

Purpose5/5

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

The description 'Search commits by message' clearly states the tool's action (search) and resource (commits) with a specific criterion (by message), distinguishing it from siblings like bitbucket_get_commits which likely retrieves all commits without message filtering.

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?

No guidance on when to use this tool over alternatives such as bitbucket_search_code or bitbucket_get_commits. The description lacks context for appropriate usage scenarios.

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

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