Skip to main content
Glama

Code Search

bitbucket_code_search
Read-onlyIdempotent

Search code across all accessible Bitbucket repositories using Lucene-style queries. Filter by file extension, path, project, or repository, and retrieve matching files with code context.

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
limitNoNumber of results per page (1-100)
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'
startNoStarting index for pagination (use nextStart from previous results)
response_formatNoOutput format: markdown (default) or jsonmarkdown

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

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

Annotations already declare readOnlyHint=true, idempotentHint=true, destructiveHint=false. The description adds that it uses Elasticsearch, returns context and line numbers, and requires a feature to be enabled, providing useful behavioral context beyond annotations.

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 concise with four sentences, front-loaded with the main action. No unnecessary words; each sentence adds value.

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

Completeness4/5

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

Given the well-described schema (100% coverage), annotations, and existence of an output schema, the description covers the essential information: scope, result format, and prerequisite. Very complete.

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 detailed parameter descriptions, so the description adds little extra. The query parameter is well-documented in the schema with examples. Baseline of 3 is appropriate.

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 tool searches code across all Bitbucket repositories using the search API, distinguishing it from repository-level search tools like bitbucket_search_repositories. It specifies the scope (all accessible repos) and output (files with context and line numbers).

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 good usage context: it searches across all accessible repositories and requires the Bitbucket Search feature to be enabled. It does not explicitly state when not to use it, but the context is clear.

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