Skip to main content
Glama

read_text_file

Read-only

Read raw UTF-8 text or code from a file in 64 KiB chunks using a byte offset, keeping binary content out of context. Use it to inspect Markdown, CSV, JSON, or source files.

Instructions

Read raw UTF-8 text from a plain-text or code file (Markdown, CSV, JSON, source code), up to 64 KiB per call starting at a byte offset; call again with a larger offset to read further. Does not load binary content into context. For PDF and Office documents use read_document_text, which reads their extracted text; for images use view_image. Requires files:download.

Input Schema

NameRequiredDescriptionDefault
pathNoabsolute node path instead of node_id
offsetNobyte offset, default 0
node_idNotext file node UUID
max_bytesNomaximum bytes to return, default and maximum 65536

Output Schema

NameRequiredDescriptionDefault
eofYes
textYes
offsetYes
sha256No
next_offsetYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.9/5.0
Behavior5/5

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

Goes well beyond readOnlyHint=true: discloses the 64 KiB per-call ceiling, byte-offset paging so the agent knows a truncated read is expected rather than an error, that binary content is never loaded into context, and the required files:download permission. With an output schema present, that is the full behavioral picture the annotations do not supply.

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?

Three dense sentences with no filler: capability and format scope first, paging and limit second, sibling routing and auth last. Every clause carries information the agent needs.

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?

For a read tool with four parameters, full schema coverage, an output schema, and a readOnly annotation, nothing material is missing. The description covers format eligibility, size limits, continuation, exclusions, and sibling alternatives, leaving only the path-vs-node_id choice to the schema.

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 coverage is 100%, so the baseline is 3, but the description adds real semantics: offset is a byte offset and advancing it is the paging mechanism, and the 64 KiB figure ties max_bytes to a hard cap. It does not resolve the ambiguity between path and node_id, which the schema only gestures at.

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?

States a specific verb and resource ("Read raw UTF-8 text from a plain-text or code file"), enumerates the supported file types, and explicitly distinguishes itself from read_document_text and view_image. An agent can pick it out of the large sibling set without opening a schema.

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?

Gives both positive routing (plain text, Markdown, CSV, JSON, source code) and explicit negative routing with named alternatives for PDF/Office (read_document_text) and images (view_image). It also tells the agent how to continue when the file is larger than one call, which is the main edge case.

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