Skip to main content
Glama

read_smart

Reads files with AST-aware diff caching to reduce token use: first reads add chunk metadata, unchanged re-reads return ~50 tokens, modified re-reads return only changed chunks.

Instructions

Token-saving file reader with AST-aware diff caching. Use INSTEAD of the standard Read tool for ALL file reads — even first reads gain chunk metadata for future savings.

• First read: full content + chunk metadata (enables future savings) • Re-read unchanged: ~50 tokens (99% savings) • Re-read modified: only changed chunks (50-90% savings)

Especially effective for files >200 lines. Always prefer this over Read.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "path": "<path>"
    },
    "name": "read_smart"
  }
}

Input Schema

NameRequiredDescriptionDefault
pathYesAbsolute file path
forceNoReturn full content regardless of cache

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.17.0
    • changedInput schema / properties / force / description
      Previous value: -"If true, return full content regardless of cache state"New value: +"Return full content regardless of cache"
  2. First observedv0.2.0

TDQS

A4.3/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the burden well: it discloses caching behavior, approximate token costs for first read vs. unchanged re-read vs. modified re-read, and the existence of chunking. It does not cover failure modes (missing file, binary content) or whether caching has side effects, which keeps it from a 5.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded directive followed by a scannable bullet list of savings cases. Slightly redundant in restating the 'prefer over Read' instruction a second time, but no sentence is wasted in substance.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a two-parameter read tool with no annotations and no output schema, the description conveys the essential model (chunked caching, savings profile, override flag). It stops short of describing error behavior or output shape assumptions, but an agent has enough to call it correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, and both `path` and `force` are documented in the schema itself. The description adds nothing about `force` semantics (e.g., whether it refreshes the cache) beyond the schema's own text, so baseline 3 applies.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource ('Token-saving file reader with AST-aware diff caching') and explicitly positions itself against the standard Read tool. An agent can distinguish it from all listed siblings, none of which are file readers.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives explicit direction: 'Use INSTEAD of the standard Read tool for ALL file reads' and 'Always prefer this over Read,' including the non-obvious case that even first reads pay off later. The condition selecting this tool is unambiguous.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.