Code Search
bitbucket_code_searchSearch 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
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Number of results per page (1-100) | |
| query | Yes | Lucene-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' | |
| start | No | Starting index for pagination (use nextStart from previous results) | |
| response_format | No | Output format: markdown (default) or json | markdown |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |