Skip to main content
Glama
jansc4
by jansc4

Read file

files_read_file
Read-onlyIdempotent

Read text files with optional line or character windows to avoid loading huge content. Returns total line count and errors on binary files, enabling efficient summarization pipelines.

Instructions

Reads a text file, optionally windowed by line range (start_line, max_lines) and/or capped by max_chars. total_lines tells you how big the file is, so you know whether/how to window a large one. Errors clearly on non-text files instead of returning garbage. Pair with for_each + build_prompts + ask_llm to summarize many files with a cheap local model instead of spending the calling agent's own context on the raw text.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYes
max_charsNo
max_linesNo
start_lineNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.5/5.0
Behavior4/5

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

Annotations already cover readOnlyHint, openWorldHint, and idempotentHint, and the description does not contradict them. It adds useful behavioral context: total_lines is exposed to indicate file size, non-text files cause clear errors rather than garbage output, and reading is presented as a non-destructive operation. This exceeds the annotation baseline.

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 well-structured and front-loaded. The first sentence states the core behavior, the second adds size-scoping guidance, the third clarifies error behavior, and the fourth gives a concrete workflow pattern. Each sentence earns its place without redundancy.

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 output schema exists and the annotations cover the tool's side-effect profile, the description supplies the remaining context needed: how to handle large files, what to expect when reading non-text files, and why this tool is useful for token-efficient summarization. An agent has enough information to invoke it correctly and choose a sensible invocation strategy.

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 carry the semantics. It explains start_line and max_lines as a line-range window and max_chars as a cap, and it references total_lines as a sizing signal. Path is self-evident from the schema. It does not spell out edge cases like how multiple limits interact, but the core meaning of every parameter is present.

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 opens with a specific action and resource: 'Reads a text file'. It goes beyond the title by defining the optional windowing/capping behavior and by making the text-file scope explicit, which differentiates it from write, preview, and binary-file operations. There is no ambiguity about what the tool does.

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 gives a clear usage context: read files, optionally window them for large files, and pair with for_each + build_prompts + ask_llm to summarize many files cheaply. It does not explicitly say when to avoid this tool or name a sibling alternative such as files_find_files or files_preview_op, so it stops just short of a 5.

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