Skip to main content
Glama

read_document_text

Read-only

Read extracted text from PDF, Office, or text files in chunks up to 50,000 characters without downloading, then use next_offset to continue.

Instructions

Read the extracted text of a PDF, Office or text file in chunks of up to 50000 characters, without downloading the file. Use next_offset to continue. For plain-text and code files where the exact bytes matter, prefer read_text_file.

Input Schema

NameRequiredDescriptionDefault
pathNoabsolute node path instead of node_id
offsetNocharacter offset, default 0
node_idNofile node UUID
max_charsNomaximum characters to return, default 20000, maximum 50000

Output Schema

NameRequiredDescriptionDefault
eofYes
nameYes
pageNopage where this chunk starts, for PDFs
textYes
totalYestotal characters of extracted text
offsetYes
truncatedNothe document was longer than the indexed text; only the beginning is available
next_offsetYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.2/5.0
Behavior4/5

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

readOnlyHint=true already declares the safe-read profile, and the description adds real value beyond it: extraction happens server-side without downloading the file, output is chunked, and continuation is expected. It does not describe error behavior (e.g., unsupported file type) or how node_id versus path resolution failures surface, but the output schema covers return shape.

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 short sentences, front-loaded with the capability, then the continuation protocol, then the alternative. Every sentence carries distinct information with no padding.

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?

With an output schema present and readOnlyHint supplied, the description only needs to cover capability, chunking and routing — all present. The lingering gap is the 'next_offset' versus 'offset' inconsistency and no note on supported/max file size or how the file is identified, though the schema handles identification.

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 100%, so the baseline is 3. The description does add chunking semantics that corroborate max_chars (up to 50000 characters), but it refers to 'next_offset' while the actual schema parameter is named 'offset' — a naming mismatch that could mislead an agent trying to continue a read.

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 the extracted text of a PDF, Office or text file') plus the chunking scope, and explicitly distinguishes itself from the read_text_file sibling. An agent can identify the tool's job without opening the schema.

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?

Names the alternative and the selecting condition clearly ('For plain-text and code files where the exact bytes matter, prefer read_text_file'), and instructs continuation via next_offset. It stops short of covering other plausible alternatives in the sibling set (search_file_contents, prepare_download, view_image), so routing is clear for the main case but not exhaustive.

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