Skip to main content
Glama

smart_read

Replace full file reads with structural summaries: retrieve classes, functions, methods with signatures and line ranges, using 60-80% fewer tokens. Drill into specific symbols as needed.

Instructions

Use INSTEAD OF Read/cat for code files. Returns code structure (classes, functions, methods with signatures and line ranges) — 60-80% fewer tokens than raw content. Use read_symbol() to drill into specific code.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYesFile path (absolute or relative to project root)
show_importsNoInclude import details (default: true)
show_docsNoInclude doc comments (default: true)
depthNoMax depth for nested symbols (default: 2)
scopeNoOutput scope: full (default, all details), nav (names + lines only, 2-3x smaller), exports (public API only)
max_tokensNoToken budget. If output exceeds this, auto-downgrades: full → outline → compact. Use for context-constrained sessions.
session_idNoOptional Claude Code session_id. When provided, dedup state (already-loaded files) persists across MCP server restarts and /clear, tied to that session. Omit to use ephemeral process-scoped dedup.
forceNoBypass dedup — return full content even if the same path was already loaded earlier in this session. Use when the prior result was compacted out of context.
Behavior4/5

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

No annotations provided, so description carries full burden. It indicates the tool is a read-only replacement for read/cat, returns structured output, and is token-efficient. It doesn't fully disclose all behavioral traits (e.g., error handling, dedup behavior) but the core behavior is clear.

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

Conciseness5/5

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

Two sentences, front-loaded with the most critical information (purpose and when to use). Every sentence adds value; no wasted words.

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 read tool with 8 parameters and no output schema, the description covers purpose, usage context, token efficiency, and references a related tool. It is sufficient for an agent to understand when and how to invoke it, though it doesn't describe the return format.

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 description coverage is 100%, so baseline is 3. The description adds no extra meaning beyond what the schema already provides for each parameter. It does not enrich parameter understanding.

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?

The description clearly states it is for code files, returns code structure (classes, functions, methods with signatures and line ranges), and explicitly differentiates from raw read/cat with token savings. It also names read_symbol as a complementary tool.

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?

Explicitly tells when to use ('Use INSTEAD OF Read/cat for code files') and when to use an alternative ('Use read_symbol() to drill into specific code'). Provides clear context for selection among siblings.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Digital-Threads/token-pilot'

If you have feedback or need assistance with the MCP directory API, please join our Discord server