Skip to main content
Glama

Code Search

bitbucket_code_search
Read-only

Search code across Bitbucket repositories using Lucene-style queries to find specific functions, files, or patterns within accessible projects.

Instructions

Search code across all Bitbucket repositories using the search API.

Uses Bitbucket's built-in code search (powered by Elasticsearch). Searches across all repositories the authenticated user has access to. Returns matching files with surrounding code context and line numbers.

Requires the Bitbucket Search feature to be enabled on the Data Center instance.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesLucene-style search query. Supports field filters and boolean operators: - File filters: ext:java, lang:python, path:src/main - Repository filters: repo:my-repo, project:PROJECT_KEY - Boolean operators: AND, OR, NOT (uppercase), use () for grouping - Examples: 'CompanyInfoUpdater', 'function ext:java', 'config AND (yaml OR yml)', 'className NOT test project:MYPROJ'
limitNoNumber of results per page (1-100)
startNoStarting index for pagination (use nextStart from previous results)

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

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

The description adds valuable behavioral context beyond the readOnlyHint annotation. It specifies that searches use 'Bitbucket's built-in code search (powered by Elasticsearch)', explains the scope ('across all repositories the authenticated user has access to'), describes the return format ('matching files with surrounding code context and line numbers'), and mentions a system requirement ('Requires the Bitbucket Search feature to be enabled'). This provides practical implementation details that annotations alone don't cover.

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 efficiently structured with four focused sentences: purpose statement, technical implementation, scope/return format, and system requirement. Every sentence adds essential information with zero redundancy, and the most critical information (what the tool does) appears first.

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

Completeness5/5

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

Given the tool's moderate complexity, comprehensive schema coverage (100%), readOnlyHint annotation, and presence of an output schema, the description provides complete contextual information. It covers purpose, technology, scope, return format, and prerequisites without needing to duplicate schema details or explain return values that the output schema will document.

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?

With 100% schema description coverage, the input schema already provides comprehensive documentation for all three parameters (query syntax, limit range, pagination). The description doesn't add any parameter-specific information beyond what's in the schema, so it meets the baseline expectation but doesn't enhance parameter understanding further.

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 clearly states the specific action ('Search code'), target resource ('across all Bitbucket repositories'), and technology ('using the search API'). It distinguishes itself from siblings like bitbucket_get_file_content (retrieves specific file content) and bitbucket_list_files (lists files without searching content) by focusing on cross-repository code search functionality.

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

Usage Guidelines4/5

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

The description provides clear context about when to use this tool: for searching code across all accessible repositories using Bitbucket's built-in search. It mentions the prerequisite ('Requires the Bitbucket Search feature to be enabled') but doesn't explicitly state when NOT to use it or name specific alternatives among the sibling tools, though the context implies it's for code search rather than file retrieval or pull request operations.

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

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