Skip to main content
Glama

pdf_extract_text

Read-only

Extracts text from PDFs or selected page ranges; uses OCR for pages without a text layer and supports paged output via offset for long documents.

Instructions

Extract text from a PDF, or from some pages ("2-5"). Pages with no text layer are read with OCR when it is installed. Long text comes in parts: pass next_offset as offset to continue.

Input Schema

NameRequiredDescriptionDefault
pagesNo
offsetNo
max_charsNo
input_pathYes
ocr_fallbackNo

Output Schema

NameRequiredDescriptionDefault
noteNo
textYes
pagesYes
methodYestext_layer, ocr, no_text_found or ocr_unavailable.
offsetYes
next_offsetYesPass as offset to read the next part. None at the end.
total_charsYes
returned_charsYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.3.0

TDQS

A3.9/5.0
Behavior4/5

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

Annotations already declare readOnlyHint and openWorldHint=false, so the safety profile is covered; the description adds genuinely new behavior — conditional OCR depending on installation and output truncation/parting semantics. It does not state what happens when OCR is not installed (silent empty text vs error).

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?

Three compact sentences, front-loaded with purpose, with the inline "2-5" example earning its place. No filler, though each sentence is dense rather than fully self-explanatory.

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, return values need not be explained, and the key behavioral caveats (OCR, pagination) are covered. A 5-param tool could still use a note on max_chars truncation thresholds, but the essentials are present.

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 coverage is 0%, so the description must carry parameter meaning and only partially does: pages syntax and offset continuation are explained, but max_chars (the truncation control driving the "parts" behavior) and ocr_fallback toggle are never mentioned. Partial compensation for the coverage gap.

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?

States a specific verb (extract) and resource (text from a PDF), with page-range scoping. It does not name the sibling alternatives (pdf_info, ocr_image, pdf_to_images) that an agent might confuse it with, but the core purpose is unambiguous.

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?

Gives concrete operational guidance: page ranges in "2-5" form, automatic OCR fallback when installed, and continuation via next_offset→offset for long output. It stops short of naming when to prefer ocr_image or pdf_info instead, so there are no explicit exclusions.

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