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