Skip to main content
Glama
jlromano

Bitbucket MCP Server

by jlromano

search_code

Search for code across Bitbucket repositories using natural language queries to locate specific files, functions, or patterns within a workspace.

Instructions

Search for code in a workspace

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
workspaceYesThe workspace slug
queryYesThe search query

Implementation Reference

  • The actual implementation of the search_code tool in the BitbucketClient class.
    async searchCode(workspace: string, query: string): Promise<any[]> {
      const response = await this.api.get(`/workspaces/${workspace}/search/code`, {
        params: { search_query: query }
      });
      return response.data.values;
    }
  • The definition and input schema for the search_code tool.
    {
      name: 'search_code',
      description: 'Search for code in a workspace',
      inputSchema: {
        type: 'object',
        properties: {
          workspace: {
            type: 'string',
            description: 'The workspace slug',
          },
          query: {
            type: 'string',
            description: 'The search query',
          },
        },
        required: ['workspace', 'query'],
      },
    },
  • src/index.ts:633-645 (registration)
    The tool execution handler in index.ts which calls the client method.
    case 'search_code': {
      const { workspace, query } = args as {
        workspace: string;
        query: string;
      };
      const results = await client.searchCode(workspace, query);
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify(results, null, 2),
          },
        ],
Behavior1/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It fails to describe any behavioral traits such as permissions required, rate limits, pagination, or what the search returns (e.g., list of files, code snippets). The phrase 'Search for code' is too generic and doesn't add meaningful context beyond the tool name.

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 with zero waste. It's front-loaded and appropriately sized for a basic tool, avoiding unnecessary elaboration. Every word contributes to stating the purpose, though it lacks depth.

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 the complexity of a search tool with no annotations and no output schema, the description is incomplete. It doesn't explain what the tool returns (e.g., search results format), behavioral aspects like performance or limitations, or how it integrates with sibling tools. For a tool with 2 parameters and no structured output, more context is needed to be fully helpful.

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%, with both parameters ('workspace' and 'query') documented in the schema. The description adds no additional meaning beyond the schema, such as examples of query syntax or workspace constraints. Baseline is 3 since the schema does the heavy lifting, but the description doesn't compensate or enhance parameter understanding.

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

Purpose3/5

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

The description 'Search for code in a workspace' states the basic action (search) and target (code), but it's vague about scope and lacks sibling differentiation. It doesn't specify what 'code' means (e.g., files, snippets, repositories) or how the search works (e.g., text matching, regex). Compared to siblings like 'get_file_content' or 'list_repositories', the distinction is implied but not explicit.

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 is provided on when to use this tool versus alternatives. For example, it doesn't clarify if this is for finding code snippets across repositories versus within a single file, or when to prefer 'get_file_content' for direct access. The description offers only a basic function without context or exclusions.

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

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