search_code
Find code snippets across Bitbucket repositories using context-aware search patterns. Filter by workspace, repository, file type, or specific code contexts like assignments, declarations, or usages.
Instructions
Search for code across Bitbucket repositories with enhanced context-aware search patterns (currently only supported for Bitbucket Server)
Input Schema
Name | Required | Description | Default |
---|---|---|---|
file_pattern | No | File path pattern to filter results (e.g., "*.java", "src/**/*.ts") (optional) | |
include_patterns | No | Additional custom search patterns to include (e.g., ["variable =", ".variable"]) (optional) | |
limit | No | Maximum number of results to return (default: 25) | |
repository | No | Repository slug to search in (optional, searches all repos if not specified) | |
search_context | No | Context to search for: assignment (term=value), declaration (defining term), usage (calling/accessing term), exact (quoted match), or any (all patterns) | |
search_query | Yes | The search term or phrase to look for in code (e.g., "variable") | |
start | No | Start index for pagination (default: 0) | |
workspace | Yes | Bitbucket workspace/project key (e.g., "PROJ") |