Skip to main content
Glama

read_file

Read a text file by path with optional 1-based inclusive start and end lines; set end_line to -1 to read to EOF.

Instructions

Read a text file. Lines are 1-based and inclusive; end_line=-1 reads to EOF.

Input Schema

NameRequiredDescriptionDefault
pathYes
end_lineNo
start_lineNo

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.6/5.0
Behavior3/5

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

No annotations exist, so the description carries the full burden; it does disclose the important line-numbering contract (1-based, inclusive, -1 sentinel for EOF), which is genuinely useful. It omits other behavioral facts an agent needs: what happens if the path does not exist, whether binary/non-UTF8 files are rejected, and whether large files are truncated.

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 compact sentences with zero filler, and the most error-prone detail (line numbering and the EOF sentinel) is front-loaded right after the purpose.

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 value shape need not be explained, and the description covers the one non-obvious calling convention. Missing error/failure semantics and encoding expectations keep it short of a 5 for a filesystem-touching tool.

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 0% (properties carry only titles), so the description must compensate. It meaningfully defines the semantics of start_line/end_line (1-based, inclusive, -1 = EOF), but says nothing about the required 'path' parameter — no indication of relative vs absolute paths or the workspace root convention.

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?

States a specific verb and resource ('Read a text file'), which clearly separates it from write-side siblings like create_file, edit_file, and replace_lines. It does not however contrast itself with search/listing siblings such as grep or glob, so the differentiation is only partial.

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

Usage Guidelines3/5

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

Usage is only implied by the verb — an agent can infer this is for retrieving file contents rather than searching or listing. There is no explicit when-to-use guidance, no mention of choosing grep/glob instead, and no note on using start_line/end_line to page through large files.

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