Skip to main content
Glama

ocr_pdf

Adds an invisible searchable text layer to scanned PDFs so text can be searched, selected and extracted. Keeps page images and supports language selection for non-English documents.

Instructions

Add an invisible text layer to a scanned PDF so its text can be searched, selected and extracted. Use this before extract_pdf_text or pdf_to_word on a scan or photographed document, and set lang when the text is not English. The page images are kept, so the output is about the same size as the input, and pages that already have text are left untouched. Takes roughly 2-10 seconds per page. Scans at 300 DPI or higher read well; below 150 DPI accuracy degrades badly. 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": "ocr_pdf"
  }
}

Input Schema

NameRequiredDescriptionDefault
fileYesAbsolute path to the scanned PDF.
langNoLanguage of the document's text as a Tesseract code: eng (English), rus (Russian), spa (Spanish), ita (Italian), uzb (Uzbek, Latin script), uzb_cyrl (Uzbek, Cyrillic) or kaz (Kazakh). For mixed documents join two with '+', for example rus+eng. Any other value is rejected. Defaults to eng.eng
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. Changed1 schema field changedv0.1.4
    • addedInput schema / properties / lang
      Added value: +{
      +  "default": "eng",
      +  "description": "Language of the document's text as a Tesseract code: eng (English), rus (Russian), spa (Spanish), ita (Italian), uzb (Uzbek, Latin script), uzb_cyrl (Uzbek, Cyrillic) or kaz (Kazakh). For mixed documents join two with '+', for example rus+eng. Any other value is rejected. Defaults to eng.",
      +  "type": "string"
      +}
  2. First observedv0.1.3

TDQS

A4.8/5.0
Behavior5/5

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

No annotations exist, so the description carries the full burden and does so richly: page images preserved and output size similar to input, already-texted pages untouched, 2-10s per page runtime, DPI thresholds for accuracy, upload to the Papyrio API processed in memory and not stored, overwrite of output_path, return value, 50 MB input cap, and one-operation quota cost.

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?

Purpose and the ordering instruction are front-loaded, and every sentence carries operational information (limits, timing, DPI, privacy, return value). It is on the dense side with several clauses per sentence, but no sentence is filler.

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?

There is no output schema, and the description compensates by stating exactly what is returned ('that path and the size in bytes'). Given the simple three-parameter schema and full behavioral disclosure, an agent has everything needed to invoke this 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 the baseline is 3; the description adds value beyond the schema by giving the conditional rule for lang ('when the text is not English') and by flagging that output_path replacement overwrites existing files. It stops short of elaborating the '+' language-joining syntax, which the schema already covers.

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?

Specific verb+resource ('Add an invisible text layer to a scanned PDF') with the outcome stated (searchable, selectable, extractable text). It is clearly distinguishable from every sibling, since none of the other tools operate on a scan to produce an OCR layer.

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?

Explicitly says to use this before extract_pdf_text or pdf_to_word on a scan or photographed document, and adds the conditional 'set lang when the text is not English'. Both the when-to-use and the ordering relative to alternatives are stated.

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