code_smart_grep
code_smart_grep runs a pattern search across the indexed codebase and passes the matches to an LLM, which returns a synthesized answer to your question rather than a raw list of matching lines.
Requires GL_SMART_READ=true in the MCP server environment.
code_smart_grep(pattern="error", question="what error types are handled?")code_smart_grep(pattern="process\.env\.", question="what environment variables are used?")Parameters
Section titled “Parameters”| Parameter | Type | Default | Description |
|---|---|---|---|
pattern | string | required | Regex pattern to search for |
question | string | required | What you want to know about the matches |
Token comparison
Section titled “Token comparison”| Approach | Tokens |
|---|---|
code_grep(pattern="error") — 40 raw matches | ~2,000 |
code_smart_grep(pattern="error", question="what error types?") | ~100 |
85% token savings with a categorized, readable answer.
When to use
Section titled “When to use”- Finding patterns across many files where you need synthesis, not a list
- Auditing error handling, env var usage, or deprecated patterns
- Any grep where you would normally have to scan through many results yourself
- Requires
GL_SMART_READ=truein the MCP server configuration - For precise single-location lookups, plain
code_grepis faster - Results are not cached (unlike
code_smart_read)