Skip to main content
Glama

read

Read a file and get full content, an 'unchanged' indicator on re-read, or a unified diff when modified, reducing token usage with intelligent caching.

Instructions

Read a file with token-efficient caching. For 2+ files, use batch_read.

Returns full content on first read, "unchanged": true on re-read of an unchanged file (content already in your context — do NOT re-read), or a unified diff when modified. Use offset/limit to recover line ranges after truncation.

Args: path: File path (absolute or relative to project root). Use absolute paths for files outside the current project root. max_size: Maximum content size to return before summarization. offset: 1-based starting line number for targeted reads. 0 is treated as "from the start" (equivalent to omitting). limit: Number of lines to return from offset.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYes
max_sizeNo
offsetNo
limitNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
truncatedNo
pathNo
contentNo
linesNo
unchangedNo
is_diffNo
semantic_matchNo
total_tokensNo
hintNo
from_cacheNo
tokens_savedNo
tokens_originalNo
tokens_returnedNo
paramsNo
is_binaryNo
sizeNo
mimeNo
content_hashNo
total_linesNo
Behavior5/5

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

No annotations provided, but description fully discloses caching behavior, return values (full content, unchanged, diff), and offset/limit handling (0 treated as start). This exceeds the burden typically carried by annotations.

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?

Efficiently structured with a concise intro, caching behavior, and bulleted Args. No fluff, each sentence adds value.

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

Completeness5/5

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

Covers caching semantics, return types, targeted reading, and file path conventions. Despite having an output schema, the description independently explains return behavior, making it fully self-contained.

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?

With 0% schema description coverage, the description compensates by explaining all 4 parameters: path (absolute/relative), max_size (before summarization), offset (1-based, 0=start), limit (number of lines). Adds significant value 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 'Read a file with token-efficient caching', specifying the verb and resource. It distinguishes from the sibling 'batch_read' by noting to use that for multiple files, making the purpose unambiguous.

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?

Provides explicit guidance: use 'batch_read' for 2+ files, describes caching behavior to avoid re-reading unchanged files, and explains when to use 'offset'/'limit' for targeted reads.

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/CoderDayton/semantic-cache-mcp'

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