Skip to main content
Glama

extract_pdf_text

Extracts PDF text as UTF-8 for reading or summarizing; for scanned PDFs without a text layer, run OCR first.

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. The input is uploaded to the Papyrio API, processed in memory and not stored. The result is written to output_path, replacing any file already there, and the call returns that path and the size in bytes. Inputs are limited to 50 MB, and each call counts as one operation against the daily quota.

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": {
      "file": "<file>"
    },
    "name": "extract_pdf_text"
  }
}

Input 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.9/5.0
Behavior5/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 so thoroughly: it discloses the upload to the Papyrio API, in-memory processing with no storage, an overwrite of output_path (a destructive side effect), the return payload (path and byte size), a 50 MB limit, and per-call quota consumption. This is exactly the behavioral context an agent needs before committing.

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?

Five tight sentences, front-loaded with the core action and immediately followed by the scanned-PDF caveat. Each sentence conveys distinct, operationally relevant information with no padding.

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?

For a two-parameter tool with no output schema, the description still explains the return value (path and byte size in bytes) and covers safety, limits, and quota. An agent has everything needed to call it correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so both parameters are already documented and the baseline is 3. The description adds genuine value beyond the schema by warning that output_path replaces any existing file and that the result is written to that path, which the schema does not state.

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') plus the downstream intent (read or summarize). It explicitly distinguishes itself from the sibling ocr_pdf, so an agent can route correctly without opening either 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 condition for use ('when the PDF already has a text layer'), an explicit exclusion ('A scanned PDF has none'), and names the alternative to run first ('run ocr_pdf on it first'). Nothing is left to inference.

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