search_text
Perform full-text search across indexed files using regex, glob patterns, and language filters to locate strings, comments, TODOs, config values, or error messages.
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: { matches: [{ file, line, text, context }], total_matches }. Set grouping: "by_file" to deduplicate file paths in results with many hits.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | Search string or regex pattern | |
| is_regex | No | Treat query as regex (default false) | |
| file_pattern | Yes | Glob filter, e.g. "src/**/*.ts" | |
| language | No | Filter by language (e.g. "typescript", "python") | |
| max_results | No | Max matches to return (default 50) | |
| 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) | |
| timeout_ms | No | Wall-clock budget in milliseconds. Catastrophic-backtracking regex cannot pin a worker beyond this. Default 2000. Set 0 to disable. | |
| grouping | No | Payload shape. "flat" returns a single matches[] array (default). "by_file" groups hits under each file — saves tokens on long paths with many hits. | flat |