Skip to content

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?")
ParameterTypeDefaultDescription
namestringrequiredFunction or class name
questionstringrequiredWhat you want to know about this function
ApproachTokens
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.

  • 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=true in the MCP server configuration
  • Digests are stored in MemOS and scoped to the project KB
  • For short, simple functions, code_get is often faster