Skip to main content
Glama
flyanima

Open Search MCP

by flyanima

search_bitbucket

Search Bitbucket repositories and code to find specific projects or code snippets using customizable queries and result limits.

Instructions

Search Bitbucket repositories and code

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesSearch query for Bitbucket repositories
maxResultsNoMaximum number of results to return

Implementation Reference

  • The execute handler implementing the core logic of search_bitbucket tool. Parses input, generates simulated Bitbucket repository search results, and returns structured ToolOutput.
    execute: async (args: ToolInput): Promise<ToolOutput> => {
      try {
        const { query, maxResults = 20 } = args;
        
        // Simulated Bitbucket search results
        const results = Array.from({ length: Math.min(maxResults, 10) }, (_, i) => ({
          name: `${query}-repo-${i + 1}`,
          fullName: `team${i + 1}/${query}-repo-${i + 1}`,
          description: `A Bitbucket repository for ${query} development`,
          url: `https://bitbucket.org/team${i + 1}/${query}-repo-${i + 1}`,
          language: ['TypeScript', 'Python', 'Java', 'C#', 'PHP'][i % 5],
          size: Math.floor(Math.random() * 10000),
          lastUpdated: new Date(Date.now() - Math.random() * 60 * 24 * 60 * 60 * 1000).toISOString(),
          isPrivate: i % 4 === 0,
          owner: `team${i + 1}`,
          cloneUrl: `https://bitbucket.org/team${i + 1}/${query}-repo-${i + 1}.git`,
          issues: Math.floor(Math.random() * 50),
          pullRequests: Math.floor(Math.random() * 20)
        }));
    
        return {
          success: true,
          data: {
            source: 'Bitbucket',
            query,
            results,
            totalResults: results.length
          },
          metadata: {
            searchTime: Date.now(),
            source: 'Bitbucket API'
          }
        };
      } catch (error) {
        return {
          success: false,
          error: `Bitbucket search failed: ${error instanceof Error ? error.message : String(error)}`,
          data: null
        };
      }
    }
  • The registry.registerTool call that defines and registers the search_bitbucket tool, including name, description, schema, and handler reference.
    registry.registerTool({
      name: 'search_bitbucket',
      description: 'Search Bitbucket repositories and code',
      category: 'developer',
      source: 'Bitbucket',
      inputSchema: {
        type: 'object',
        properties: {
          query: {
            type: 'string',
            description: 'Search query for Bitbucket repositories'
          },
          maxResults: {
            type: 'number',
            description: 'Maximum number of results to return',
            default: 20,
            minimum: 1,
            maximum: 100
          }
        },
        required: ['query']
      },
      execute: async (args: ToolInput): Promise<ToolOutput> => {
        try {
          const { query, maxResults = 20 } = args;
          
          // Simulated Bitbucket search results
          const results = Array.from({ length: Math.min(maxResults, 10) }, (_, i) => ({
            name: `${query}-repo-${i + 1}`,
            fullName: `team${i + 1}/${query}-repo-${i + 1}`,
            description: `A Bitbucket repository for ${query} development`,
            url: `https://bitbucket.org/team${i + 1}/${query}-repo-${i + 1}`,
            language: ['TypeScript', 'Python', 'Java', 'C#', 'PHP'][i % 5],
            size: Math.floor(Math.random() * 10000),
            lastUpdated: new Date(Date.now() - Math.random() * 60 * 24 * 60 * 60 * 1000).toISOString(),
            isPrivate: i % 4 === 0,
            owner: `team${i + 1}`,
            cloneUrl: `https://bitbucket.org/team${i + 1}/${query}-repo-${i + 1}.git`,
            issues: Math.floor(Math.random() * 50),
            pullRequests: Math.floor(Math.random() * 20)
          }));
    
          return {
            success: true,
            data: {
              source: 'Bitbucket',
              query,
              results,
              totalResults: results.length
            },
            metadata: {
              searchTime: Date.now(),
              source: 'Bitbucket API'
            }
          };
        } catch (error) {
          return {
            success: false,
            error: `Bitbucket search failed: ${error instanceof Error ? error.message : String(error)}`,
            data: null
          };
        }
      }
    });
  • Input schema defining the expected parameters for the search_bitbucket tool: query (required string) and maxResults (optional number, 1-100).
    inputSchema: {
      type: 'object',
      properties: {
        query: {
          type: 'string',
          description: 'Search query for Bitbucket repositories'
        },
        maxResults: {
          type: 'number',
          description: 'Maximum number of results to return',
          default: 20,
          minimum: 1,
          maximum: 100
        }
      },
      required: ['query']
    },
  • src/index.ts:238-238 (registration)
    Top-level registration call in the main server initialization that invokes registerGitLabBitbucketTools, thereby registering search_bitbucket among others.
    registerGitLabBitbucketTools(this.toolRegistry);    // 2 tools: search_gitlab, search_bitbucket
  • Additional runtime input validation schema mapping for search_bitbucket using the basicSearch Zod schema in the global input validator.
    'search_bitbucket': ToolSchemas.basicSearch,
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 but only states the action without details on permissions, rate limits, pagination, or response format. It lacks critical information for a search operation, such as result structure or error handling.

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 extremely concise with a single, front-loaded sentence that directly states the tool's function. There is no wasted language, making it efficient and easy to parse.

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 tool's complexity (search operation with 2 parameters), lack of annotations, and no output schema, the description is incomplete. It fails to address behavioral aspects like authentication needs, result formatting, or error cases, which are essential for effective tool 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?

The input schema has 100% description coverage, so the baseline is 3. The description adds no additional parameter semantics beyond what the schema provides (e.g., it doesn't clarify query syntax or result types), but it doesn't need to compensate for gaps.

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 tool's purpose with specific verbs ('search') and resources ('Bitbucket repositories and code'), making it immediately understandable. However, it doesn't differentiate from sibling search tools like search_gitlab or search_ieee, which prevents a perfect score.

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 provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites, context for Bitbucket-specific searches, or comparisons to other search tools in the sibling list, leaving the agent without usage direction.

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/flyanima/open-search-mcp'

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