search_text
Search all indexed files for any string or regex pattern — find comments, TODOs, config values, and error messages. Filter by language or file glob for precise results.
Instructions
Full-text search across all indexed files. Supports regex, glob file patterns, language filter. Use for finding strings, comments, TODOs, config values, error messages — anything not captured as a symbol. For symbol search (functions, classes) use search instead. Read-only. Returns JSON: { files: [{ file, language, hits: [{ line, column, match, context }] }], total_matches } — hits grouped per file, so a long path is paid once. Pass grouping: "flat" for the ungrouped matches[] shape.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | Search string or regex pattern | |
| grouping | No | Payload shape. "by_file" (default) groups hits per file, so a long path is paid once; "flat" is a single matches[] array. | by_file |
| is_regex | No | Treat query as regex (default false) | |
| language | No | Filter by language (e.g. "typescript", "python") | |
| timeout_ms | No | Wall-clock budget in ms — caps a catastrophic-backtracking regex. Default 2000; 0 disables. | |
| max_results | No | Max matches to return (default 50) | |
| file_pattern | No | Glob filter, e.g. "src/**/*.ts" | |
| context_lines | No | Lines of context before/after each match (default 0 — set higher if you need surrounding code) | |
| case_sensitive | No | Case-sensitive search (default false) |