Skip to main content
Glama
zhanglc

Bitbucket MCP Server

by zhanglc

search_code

Search Bitbucket repositories for code using context-aware patterns (assignment, declaration, usage, exact) to locate relevant matches efficiently.

Instructions

Search for code across Bitbucket repositories with enhanced context-aware search patterns (currently only supported for Bitbucket Server)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoMaximum number of results to return (default: 25)
startNoStart index for pagination (default: 0)
workspaceYesBitbucket workspace/project key (e.g., "PROJ")
repositoryNoRepository slug to search in (optional, searches all repos if not specified)
file_patternNoFile path pattern to filter results (e.g., "*.java", "src/**/*.ts") (optional)
search_queryYesThe search term or phrase to look for in code (e.g., "variable")
search_contextNoContext to search for: assignment (term=value), declaration (defining term), usage (calling/accessing term), exact (quoted match), or any (all patterns)
include_patternsNoAdditional custom search patterns to include (e.g., ["variable =", ".variable"]) (optional)
Behavior2/5

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

With no annotations, the description carries the full burden of behavioral disclosure. It only hints at 'enhanced context-aware search patterns' without explaining what that means, nor does it disclose read-only nature, result format, pagination behavior, or any side effects. For a search operation, the agent is left guessing about the return payload and exact behavior beyond the schema.

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, well-structured sentence. It leads with the primary action and resource, then adds a critical constraint (Bitbucket Server only). Every word is useful and no information is wasted, making it appropriately concise and front-loaded.

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?

Despite having 8 parameters and no output schema, the description is minimal and does not explain key aspects such as the structure of results, default behavior (e.g., all repositories), or the meaning of 'context-aware' search. It lacks critical context that an agent needs to confidently invoke the tool, especially given the absence of annotations and output schema.

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%, so the baseline is 3. The description's phrase 'context-aware search patterns' loosely maps to the 'search_context' parameter, but it does not add meaningful parameter-specific information beyond what the schema already provides. It does not clarify usage of parameters like 'file_pattern' or 'include_patterns' 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 tool's function: 'Search for code across Bitbucket repositories.' It uses a specific verb ('search'), names the resource ('code' in Bitbucket repositories), and is distinct from sibling tools (which focus on pull requests, branches, and file content). The mention of 'enhanced context-aware search patterns' further specifies its unique capability, though not fully detailed.

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 for when to use the tool (searching code) and includes an explicit constraint: 'currently only supported for Bitbucket Server.' This helps agents avoid using it for Bitbucket Cloud. However, it does not mention alternatives because no sibling tools offer code search, so the 'when-not' is partially covered by the server restriction.

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

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