Skip to main content
Glama

ocr_pdf

Add a searchable text layer to scanned PDFs, making them selectable and searchable. Use before extracting text from scans or photographed documents.

Instructions

Add a searchable text layer to a scanned PDF, making it selectable and searchable. Use this before extracting text from a scan or a photographed document. Scans at 300 DPI or higher read well; below 150 DPI the result degrades badly.

Input Schema

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

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.3

TDQS

A4/5.0
Behavior3/5

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

With no annotations, the description carries the full behavioral burden. It usefully discloses the DPI quality threshold (300+ good, <150 degrades badly), but omits whether the input file is modified in place, language support, and processing-time expectations for a potentially slow operation.

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 tight sentences, front-loaded with the core action and effect, followed by usage and constraint. No redundancy or filler.

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?

No output schema exists, but the description plus the schema's output_path default adequately convey the write-and-return-a-file behavior. The main remaining gap is language handling and whether the source file is left untouched.

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% and both parameters are fully documented there, so the baseline is 3. The description adds contextual input framing ('scanned PDF', quality constraints) but no syntax or format detail 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?

States a precise verb+resource+effect: 'Add a searchable text layer to a scanned PDF, making it selectable and searchable.' This clearly separates it from siblings like extract_pdf_text or pdf_to_word, which consume text rather than generate it.

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 explicit when-to-use guidance ('Use this before extracting text from a scan or a photographed document'), including a quality precondition tied to DPI. It implies extract_pdf_text as the follow-on step but does not name it as an alternative or state when-not to use OCR.

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