Skip to main content
Glama
pdf-toolkit-mcp

pdf-toolkit-mcp

by 0xmortuex

read_pdf

Read-only

Extracts PDF text page by page with page-range selection and token-limited output, and reports scanned pages lacking a text layer instead of returning empty content.

Instructions

Read the text of a PDF, page by page, each page headed '--- Page N of M ---'.

Output is capped at roughly max_tokens. When it is cut off, the last line says exactly which pages= value to pass to continue. Pages without a text layer (scanned images) are reported as such instead of coming back empty; there is no OCR.

pages: 1-based ranges like '1-3,5,7-' ('7-' = page 7 to the end). Empty = all pages. layout: true keeps the visual column layout (better for forms and statements; wider output). max_tokens: output budget, about 4 characters per token.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "path": "<path>"
    },
    "name": "read_pdf"
  }
}

Input Schema

NameRequiredDescriptionDefault
pathYes
pagesNo
layoutNo
passwordNo
max_tokensNo

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.8/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=true, destructiveHint=false and openWorldHint=false, so the safety profile is covered elsewhere. The description nonetheless adds real behavioral value: a max_tokens cap, a self-describing truncation marker that names the next pages= value, explicit absence of OCR, and a note that layout=true widens output.

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?

It is front-loaded with the core behavior and output format, then uses one line per parameter with zero filler. Every sentence, including the scanned-page caveat, adds information an agent needs to call it correctly.

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?

For a five-parameter extraction tool with an output schema, the description covers output framing, truncation and continuation, layout tradeoffs and the OCR limitation. The remaining gap is password handling for encrypted files, which an agent cannot infer from the schema titles alone.

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 0%, so the description must carry the parameter burden. It does well for pages (1-based ranges, '7-' meaning to the end, empty = all), layout (column-layout tradeoff) and max_tokens (roughly 4 characters per token), but never mentions the password parameter for encrypted PDFs, leaving one of five parameters undocumented anywhere.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description opens with a specific verb and resource: 'Read the text of a PDF, page by page,' and even specifies the output framing ('--- Page N of M ---'). It implicitly separates itself from text-searching siblings like search_pdf by promising full sequential text, but it never names or contrasts a sibling explicitly.

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?

It gives concrete usage context: layout=true is recommended for forms and statements, scanned pages are reported rather than returned empty, and truncation tells the agent exactly what continuation call to make. What is missing is an explicit statement of when to prefer a sibling (search_pdf, pdf_info) over a full read.

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