search
Find code by meaning across a repository using semantic and keyword matching, with modes for files, identifiers, or both.
Instructions
Search the codebase by MEANING. Modes: 'file' searches file headers/symbols, 'identifier' searches function/class definitions with call chains, 'hybrid' (default) runs both and returns combined results. Uses embeddings for semantic matching plus keyword overlap scoring. For an exact known symbol name in a language with a real language server available (e.g. via an LSP-backed MCP like Serena), prefer that for go-to-definition — this tool is best for meaning-based / fuzzy discovery across the whole repo.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mode | No | Search mode: 'file' for files, 'identifier' for functions/classes, 'hybrid' for both. Default: hybrid. | |
| root | No | Absolute project root. Required with linked worktrees; subagents must pass their own worktree root on every call. | |
| query | Yes | Natural language description of what you're looking for. | |
| top_k | No | Number of matches to return. Default: 5. | |
| format | No | text (default), compact JSON for agents, or verbose json for diagnostics. | |
| fusion | No | How to combine semantic + keyword scores in file mode. 'rrf' (default) fuses rank positions and is robust when signal scales differ. 'weighted' is an opt-out that blends by semantic_weight/keyword_weight. | |
| preset | No | Ranking preset. fast favors cheap lexical recall, balanced is default, exhaustive returns a wider set, semantic_only ignores keyword overlap (pure embedding similarity), keyword_only ignores embedding similarity (pure lexical match). | |
| profile | No | Include phase timings in JSON/compact output for diagnosis. | |
| inline_code | No | Inline source with file matches. 'crux' (default) returns an ~8-line relevant span, 'full' returns the matched definition body, and 'off' returns pointers only. | |
| include_kinds | No | Filter identifier kinds, e.g. ["function", "method"]. Only for identifier/hybrid mode. | |
| keyword_weight | No | Weight for keyword overlap. Default: 0.28. | |
| semantic_weight | No | Weight for embedding similarity. Default: 0.72. | |
| min_keyword_score | No | Minimum keyword score filter. Accepts 0-1 or 0-100. | |
| min_combined_score | No | Minimum final score filter. Accepts 0-1 or 0-100. | |
| min_semantic_score | No | Minimum semantic score filter. Accepts 0-1 or 0-100. | |
| include_dependencies | No | Add up to three import pointers from the top two file matches to check supporting code. | |
| require_keyword_match | No | When true, only return results with keyword overlap. | |
| require_semantic_match | No | When true, only return results with positive semantic similarity. | |
| top_calls_per_identifier | No | How many ranked call sites per identifier (identifier/hybrid mode). Default: 10. |