Skip to main content
Glama

Read PDF text

pdf_read
Read-only

Reads text from PDFs with a text layer, page by page, reconstructing paragraphs and marking headings. Returns 1-based page numbers for paging.

Instructions

Read the text of a PDF, page by page, with the page layout reconstructed into paragraphs.

Returns 1-based page numbers with their text. Headings are marked with a leading "# " so the structure of the page is visible. Pages are paged: pass from/to to move through the document.

This only works on PDFs that carry a text layer. If the PDF is a scan (pdf_info reports scanned: true), there is no text to extract and this tool refuses — render the pages with pdf_render_page and read them as images instead.

For a scanned PDF you can still use pdf_outline to learn which page a chapter starts on, then pass that page to pdf_render_page.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
toNoLast page to read, inclusive.
fromNoFirst page to read, 1-based (default 1).
modeNoparagraphs (default) merges visual lines into paragraphs; lines keeps one entry per visual line (useful for tables).
pathYesPath to the PDF.
max_charsNoCharacter budget for this call (default 9000).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.7/5.0
Behavior5/5

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

Annotations only declare readOnlyHint=true and openWorldHint=false, but the description goes further: it discloses that the tool actively *refuses* on scan-only PDFs, describes the return shape (1-based page numbers, headings prefixed with '# '), and notes pages are paged via from/to. That is behavioral context the annotations cannot carry.

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 paragraphs, front-loaded with the core behavior, then the scan caveat, then the fallback path. Every sentence carries information an agent needs; nothing is padded.

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?

There is no output schema, yet the description itself explains the return format (pages with text, heading markers, page numbering) and the failure mode. Combined with 100% schema coverage for inputs, an agent has everything required to call and interpret this 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 100%, so from/to/mode/max_chars are already documented in the schema — baseline 3 applies. The description only restates pagination via from/to and implies the paragraph mode; it adds no format, bounds, or budget guidance beyond the schema.

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?

Opens with a specific verb and resource ('Read the text of a PDF, page by page') and immediately scopes what it returns (paragraph-reconstructed text with 1-based page numbers). It also carves out its niche against siblings by distinguishing text-layer PDFs from scans that require pdf_render_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 states when the tool works (PDFs with a text layer), when it does not (scanned PDFs, i.e. pdf_info reports scanned: true), and what to do instead — render with pdf_render_page or locate the chapter via pdf_outline first. This is a near-complete decision tree for the caller.

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