search
Find symbols in source code by name, kind, or text. Supports filters for language, file pattern, and fuzzy matching.
Instructions
Search symbols by name, kind, or text. Use instead of Grep when looking for functions, classes, methods, or variables in source code. For raw text/string/comment search use search_text instead. For finding who references a known symbol use find_usages instead. Supports kind/language/file_pattern filters. Set fuzzy=true for typo-tolerant search (trigram + Levenshtein). For natural-language / conceptual queries set semantic="on" (requires an AI provider configured + embed_repo run once). Set fusion=true for Signal Fusion — multi-channel ranking (BM25 + PageRank + embeddings + identity match) via Weighted Reciprocal Rank fusion. Use mode to switch retrieval strategy: single (default — top-K, current behavior), tiered (high/medium/low buckets), drill (scope to a parent_path/parent_symbol_id subtree via drill_from), flat (raw FTS hits, cheapest), get (exact path/symbol_id lookup, no search). Read-only. Returns JSON: { items: [{ symbol_id, name, kind, fqn, signature, file, line, score }], total, search_mode } — mode-specific shape when mode!=single. Set output_format: "toon" for lossless TOON encoding — cheaper LLM tokens on tabular payloads.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | Search query | |
| kind | No | Filter by symbol kind (class, method, function, etc.) | |
| language | Yes | Filter by language | |
| file_pattern | Yes | Filter by file path pattern | |
| implements | No | Filter to classes implementing this interface | |
| extends | No | Filter to classes/interfaces extending this name | |
| decorator | No | Filter to symbols with this decorator/annotation/attribute (e.g. "Injectable", "Route", "Transactional") | |
| fuzzy | No | Enable fuzzy search (trigram + Levenshtein). Auto-enabled when exact search returns 0 results. | |
| fuzzy_threshold | No | Minimum Jaccard trigram similarity (default 0.3) | |
| max_edit_distance | No | Maximum Levenshtein edit distance (default 3) | |
| semantic | No | Semantic mode: auto (default — hybrid if AI available), on (force hybrid), off (lexical-only), only (pure vector). Requires AI provider + embed_repo for non-"off" modes. | |
| semantic_weight | No | Hybrid fusion weight in [0,1]. 0 = lexical only, 0.5 = balanced (default), 1 = semantic only. | |
| fusion | No | Enable Signal Fusion Pipeline — multi-channel WRR ranking across lexical (BM25), structural (PageRank), similarity (embeddings), and identity (exact/prefix/segment match). Produces better results than single-channel search. | |
| fusion_weights | No | Per-channel weights for fusion (auto-normalized). Defaults: lexical=0.4, structural=0.25, similarity=0.2, identity=0.15. | |
| fusion_debug | No | Include per-channel rank contributions in fusion results. | |
| limit | No | Max results (default 20) | |
| offset | No | Offset for pagination | |
| mode | No | Memoir-style retrieval mode: single (default — top-K), tiered (high/medium/low buckets), drill (scoped to drill_from), flat (raw FTS, no PageRank), get (exact lookup). Omit to auto-pick (path-shaped query → get, otherwise → single). | |
| drill_from | No | Drill scope for mode="drill" — a file path or symbol_id. Results are restricted to the subtree rooted here. | |
| detail_level | No | Output verbosity. "minimal" returns ~40-60% fewer tokens (drops scores, fqn, signatures, summaries — keeps name/file/line). Use when you only need to pick a candidate before drilling in with get_symbol. Default: "default". | |
| output_format | No | Output format. "json" (default) returns JSON; "toon" returns Token-Oriented Object Notation — 30-60% fewer tokens, lossless. "markdown" is unsupported here and behaves as json. |