Skip to main content
Glama

read_file

Read a text file, remember prior reads, and return UNCHANGED or a diff on re-read; optionally request line ranges or force full content.

Instructions

Read a text file, remembering what you were given this session.

Reading it again returns "UNCHANGED" (a few tokens) or only a unified diff against your earlier copy. Prefer it over re-reading a file you already read in this session. Pass force=true if the earlier copy is no longer in your context (e.g. after a context compaction). With start_line/end_line (e.g. a range from project_map) only those lines are returned.

Args: path: Absolute path of the file. force: Return the full content even if it has not changed. start_line: First line to return (1-based); 0 for the whole file. end_line: Last line to return (inclusive); 0 for the end of the file.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYes
forceNo
end_lineNo
start_lineNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does disclose meaningful behavior beyond the schema: repeat reads return 'UNCHANGED' or a unified diff, and force bypasses that optimization. It does not cover error behavior (missing path, non-text/binary files) or any permission/size constraints, but the caching semantics are unusually well surfaced.

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-loads the most decision-relevant fact (session caching and the UNCHANGED/diff behavior) before the parameter block, and every sentence earns its place. The Args list duplicates the schema field names, but with 0% schema description coverage that repetition is functional rather than wasteful.

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?

An output schema exists, so return values need not be described, yet the description still explains the two non-obvious return forms (UNCHANGED, unified diff). Given no annotations and a four-parameter tool, the only real gap is failure-mode behavior, which is minor for a read operation.

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?

Schema description coverage is 0%, so the description must supply all parameter meaning, and it does: path is absolute, force returns full content, start_line is 1-based with 0 meaning whole file, end_line is inclusive with 0 meaning end of file. This fully compensates for the empty schema, though it mostly restates the documented defaults rather than adding edge-case guidance (e.g. start_line > end_line).

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

Purpose4/5

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

The opening sentence states a specific verb and resource (read a text file) and adds a non-obvious scope trait: session-scoped memory of prior reads. It references project_map as a source of line ranges, but it does not explicitly differentiate itself from other retrieval siblings like find_code or recall, which are plausible alternatives for getting code into context.

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?

Gives clear when-to-use guidance: prefer this over re-reading a file already read in the session, and use force=true specifically when the earlier copy was lost after a context compaction. It stops short of naming an explicit alternative tool or stating when this tool is the wrong choice.

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