code_smart_read
code_smart_read sends a function’s code to MemOS and returns a concise digest that answers your specific question about it. The digest is auto-saved to memory so future queries on the same function are instant.
Requires GL_SMART_READ=true in the MCP server environment.
code_smart_read(name="authenticate", question="what auth strategy does this use?")code_smart_read(name="PaymentService.charge", question="when does this throw?")Parameters
Section titled “Parameters”| Parameter | Type | Default | Description |
|---|---|---|---|
name | string | required | Function or class name |
question | string | required | What you want to know about this function |
Token comparison
Section titled “Token comparison”| Approach | Tokens |
|---|---|
code_get("authenticate") — full 200-line function | ~1,800 |
code_smart_read(name="authenticate", question="what auth strategy?") | ~50 |
80–90% token savings, with the answer auto-cached for instant recall.
When to use
Section titled “When to use”- Understanding an unfamiliar function quickly without loading its full body
- Long functions (>100 lines) where you only need a specific aspect
- Repeated questions about the same function — the cache returns instantly
- Requires
GL_SMART_READ=truein the MCP server configuration - Digests are stored in MemOS and scoped to the project KB
- For short, simple functions,
code_getis often faster