Skip to main content
Glama

Read text file

read_text_file
Read-onlyIdempotent

Read one file as whole, head/tail, or a 1-based line range; extract text from PDF, Word, Excel, email, and HTML, and report total lines for edits.

Instructions

Read one file. Whole file by default; head/tail = N lines from an edge; offset/limit = an arbitrary 1-based line range, which also reports total lines and rev (needed for edit_file line edits). Documents (PDF, DOCX, XLSX, PPTX, ODF, EPUB, MSG…) come as numbered lines with section markers, no rev, read-only; HTML, RTF, EML and FB2 read raw, extract:true gives their text. Several files at once: read_multiple_files; images and page images: read_media_file / read_pdf_page.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
headNo
pathYes
tailNo
limitNoNumber of lines from offset
offsetNoFirst line, 1-based
extractNoHTML/RTF/EML/FB2: their text instead of the raw file

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.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, idempotentHint and destructiveHint=false, so safety is handled. The description adds genuinely new behavior: documents come back read-only with no rev, offset/limit reports total lines and rev (required for edit_file line edits), and HTML/RTF/EML/FB2 read raw unless extract:true. It stops short of describing pagination or exact return shapes, but the important rev/read-only nuances are disclosed.

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?

A single front-loaded paragraph that begins with the core action and then layers modes, content-type behavior, and sibling routing. Dense but essentially every clause carries information; the long compound sentences slightly hurt scannability.

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?

No output schema exists, so the description correctly mentions return-relevant facts (total lines, rev, numbered lines with section markers) and rev's role for edit_file. It is nearly complete for a 6-param read tool, though it never clarifies its relationship to the read_file sibling, leaving one ambiguity.

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 only 50% (head, tail and path are undocumented in the schema), so the description must compensate. It does: head/tail = 'N lines from an edge', offset/limit = 'an arbitrary 1-based line range', and extract:true = their text for HTML/RTF/EML/FB2. Only the interplay/precedence between head and tail and limit is left implicit.

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 one file') and then enumerates the distinct read modes (whole file, head/tail edge slices, offset/limit 1-based ranges, document/HTML/RTF handling). An agent can tell exactly what the tool does and how it differs from read_multiple_files, read_media_file, and read_pdf_page.

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?

Explicitly routes to alternatives with conditions: 'Several files at once: read_multiple_files; images and page images: read_media_file / read_pdf_page.' It also states which modes apply to which content types (documents vs HTML/RTF/EML/FB2), leaving little to inference.

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