Skip to main content
Glama

extract_pdf_text

Extract text from a PDF as UTF-8 to read or summarize it. Works when the PDF has a text layer; run OCR first on scanned files.

Instructions

Return the text of a PDF as UTF-8, so it can be read or summarized. Fast and exact when the PDF already has a text layer. A scanned PDF has none — run ocr_pdf on it first.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
fileYesAbsolute path to the PDF.
output_pathNoAbsolute path to write the result to. Defaults to the input file with a "-papyrio.txt" suffix.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.3

TDQS

A4.4/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does disclose the key behavioral traits: the output encoding (UTF-8), the performance profile (fast and exact with a text layer), and the failure mode plus remediation for scanned PDFs. It does not mention that the default output_path causes the tool to write a file to disk rather than only returning text, nor any error/permission behavior, so it falls short of a 5.

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, zero filler, and the primary capability is front-loaded ahead of the caveat and the alternative. Every sentence carries a distinct piece of information (output, success condition, failure condition + fallback).

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 2-parameter tool with no output schema and no annotations, the description covers the return value type and the critical input-quality precondition, which is what an agent needs to call it correctly. The only gap is that the file-writing side effect implied by output_path is left entirely to the schema.

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 both parameters (file, output_path, including the '-papyrio.txt' default) are already documented in the schema. The description adds no syntax, format, or path-handling detail beyond what the schema provides, so the baseline 3 applies.

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 ('Return the text of a PDF as UTF-8') and explicitly contrasts itself with the sibling ocr_pdf by naming the condition that distinguishes them (text layer vs. scanned). An agent can select this over the other eleven siblings without opening a schema.

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?

Gives an explicit when-to-use ('Fast and exact when the PDF already has a text layer'), an explicit when-not ('A scanned PDF has none'), and names the alternative to run first ('run ocr_pdf on it first'). The routing decision is fully resolved in the description.

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