Skip to main content
Glama

smart_read

Reads files by automatically selecting the optimal detail level per code block based on query relevance, saving tokens while preserving all query-relevant information.

Instructions

Read a file with automatic resolution optimization.

Instead of choosing between full/map/signatures mode, SRP automatically selects the optimal resolution for each code block based on query relevance and token budget:

  • Blocks matching the query → FULL (complete source)

  • Related blocks → MEDIUM (signature + docstring)

  • Peripheral blocks → LOW (name only)

  • Irrelevant blocks → SKIP (omitted)

This saves 40-70% tokens vs full-file reads while preserving all query-relevant detail.

Args: file_path: Path to the file to read query: What you're looking for (improves relevance scoring) budget: Target token budget for the output (default: 1000)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryNo
budgetNo
file_pathYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior5/5

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

No annotations are provided, so the description carries full behavioral burden. It fully discloses the automatic resolution selection logic (FULL, MEDIUM, LOW, SKIP) based on query relevance and token budget, and quantifies benefit (40-70% token savings). This level of detail is exceptional for transparency.

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?

The description is highly concise and well-structured: a one-line summary, a bullet list of resolution levels, a benefit sentence, and an Args section. Every sentence adds value without redundancy. It is front-loaded with the key innovation.

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?

The description explains the core mechanism and benefits thoroughly. However, it does not describe the return value structure (though an output schema exists). For a read tool, the agent might infer the output format, but explicit mention of what the tool returns (e.g., structured content with metadata) would enhance completeness.

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

Parameters5/5

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

Schema description coverage is 0%, meaning the schema provides no parameter explanations. The description compensates fully by explaining each parameter in the Args section: file_path (path to file), query (improves relevance scoring), budget (target token budget, default 1000). This adds significant meaning beyond the schema.

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 that smart_read reads a file with automatic resolution optimization. It uses specific verbs ('Read') and resource ('file'), and distinguishes itself from full/map/signatures modes by explaining the multi-resolution approach (FULL/MEDIUM/LOW/SKIP). No sibling tool offers this automatic optimization, so purpose is well-defined.

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

Usage Guidelines4/5

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

The description provides clear context for when to use this tool (instead of choosing resolution manually) and highlights token savings (40-70%). However, it does not explicitly state when not to use it or mention alternatives among sibling tools (e.g., recall_relevant, repo_file_map), which would further guide an AI agent.

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/juyterman1000/entroly'

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