search
Find functions, classes, methods, and variables by name, kind, or text. Returns ranked symbol matches with file and line info, replacing grep for code symbols.
Instructions
Search symbols by name, kind, or text. Use instead of Grep for functions, classes, methods, variables. For raw text/comment search use search_text; for references to a known symbol use find_usages. Read-only. Returns JSON: { items: [{ symbol_id, name, kind, fqn, signature, file, line, score }], total, search_mode } — mode-specific shape when mode!=single. Supports output_format: "toon".
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| kind | No | Filter by symbol kind (class, method, function, etc.) | |
| mode | No | 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. | |
| fuzzy | No | Typo-tolerant search. Auto-enabled when exact search returns 0 results. | |
| limit | No | Max results (default 20) | |
| query | Yes | Search query | |
| fusion | No | Enable Signal Fusion — multi-channel WRR ranking across lexical (BM25), structural (PageRank), similarity (embeddings), and identity match. Weights come from `tune_weights`. | |
| offset | No | Offset for pagination | |
| extends | No | Filter to classes/interfaces extending this name | |
| language | No | Filter by language | |
| semantic | No | auto (default): hybrid if AI available. on: force hybrid. off: lexical-only. only: pure vector. Non-"off" needs an AI provider + one embed_repo run. | |
| decorator | No | Filter to symbols carrying this decorator/annotation/attribute | |
| retriever | No | Run one named retrieval algorithm instead of the mode dispatcher. Ignores mode/filters/fuzzy/fusion; returns { retriever, items, total }. | |
| drill_from | No | [mode="drill"] File path or symbol_id to restrict results to. | |
| implements | No | Filter to classes implementing this interface | |
| 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". | |
| file_pattern | No | Filter by file path pattern | |
| output_format | No | "json" (default) or "toon" (lossless, 30-60% fewer tokens). "markdown" behaves as json here. | |
| fuzzy_threshold | No | [fuzzy] Min trigram similarity (default 0.3) | |
| semantic_weight | No | [semantic] 0 = lexical only, 0.5 = balanced (default), 1 = vector only. | |
| max_edit_distance | No | [fuzzy] Max edit distance (default 3) |