Skip to main content
Glama

read_file

Read files with lossless deduplication: first read returns full content, later reads return diffs for changes or reuse markers for unchanged views, with optional symbol and line-range reads.

Instructions

Read a text file through the context ledger. The FIRST read of a file/view (or the first after a context compaction) returns full content. A later read of an UNCHANGED view returns a short "reuse what you have" marker. A later read of a CHANGED view returns a unified DIFF to apply to the copy you already have. Optionally read just one symbol (function/class by name) or a line range instead of the whole file. All dedup is lossless: it only diffs/withholds content it can prove you still have. Every read is metered (see context_stats) and attested in the signed context receipt. Pass force_full:true for the whole content regardless.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYesPath to the file to read (absolute, or relative to the server cwd).
linesNoReturn only this 1-based inclusive line range, e.g. "40-90".
symbolNoReturn only this function/class/type by name (heuristic brace/indent extraction).
force_fullNoReturn full content even when a diff or unchanged-marker would suffice.
Behavior5/5

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

With no annotations provided, the description carries full burden and exceeds expectations. It discloses the deduplication algorithm, lossless property, metering, signed receipt, and the exact semantics of force_full. It also clarifies that a later read returns either a marker or a diff, giving the agent a complete mental model of the tool's behavior.

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?

The description is somewhat long but information-dense. Every sentence adds value, from the initial purpose to the lossless guarantee and force_full option. The structure front-loads the core purpose, then explains edge cases, and ends with a concrete override—logical and easy to parse, though not as terse as the highest-caliber examples.

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?

Given the tool's complexity and lack of an output schema, the description is thorough enough. It specifies return behavior for every scenario (full content, marker, diff) and mentions integration points like context_stats and signed receipts. The agent can confidently select and invoke this tool without needing further documentation.

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

Parameters4/5

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

Though the schema already covers all four parameters, the description adds extra meaning: it explains that 'lines' is a 1-based inclusive range, 'symbol' uses heuristic extraction, and force_full overrides the diff mechanism. This goes beyond the schema's dry parameter names and enriches the agent's understanding of when each parameter is useful.

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 the tool's function: 'Read a text file through the context ledger.' It specifies the resource (text file) and the verb (read), and uniquely distinguishes itself from siblings like read_files by detailing the deduplication/diff behavior and optional symbol/line-range reads.

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 on behavior under different conditions (first read vs. later reads, unchanged vs. changed views) and explains when to use options like symbol, lines, and force_full. However, it does not explicitly name alternative tools or state when not to use this tool, so it stops short of full exclusion guidance.

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/NORTHTEKDevs/lossless-context-mcp'

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