Skip to main content
Glama

OCRmyPDF by pagespool

OCR a scanned PDF or image

ocr_pdf

Queue a scanned PDF, PNG or JPEG for OCR with OCRmyPDF and Tesseract.

The result is the same document with a searchable text layer, as PDF/A by default. Pass the file as base64 in content_base64 (up to 4 MB) or as a download link in file (up to 25 MB), and its name in filename. Up to 200 pages; an image is one page.

Returns job_id, status, pages and credits. Call get_ocr_result with the job_id until status is succeeded or failed; a job is stopped after 15 minutes.

Requires an API key. Costs 2 credits per page, charged now and refunded if the job fails. The result is kept for 7 days.

Input Schema

NameRequiredDescriptionDefault
fileNoThe file as a download link, instead of `content_base64`. In ChatGPT, pass the user's uploaded file here. Other clients can set `download_url` to a public https URL.
modeNoPages that already have text: skip them (the default), redo an earlier OCR layer, or force OCR on every page as an image.skip
deskewNoStraighten crooked pages. Not with mode=redo.
filenameYesThe file name with its extension: .pdf, .png, .jpg or .jpeg.
languageNoThe document's language: eng, deu, spa or fra.eng
output_typeNopdfa (PDF/A-2b, the default) or pdf.pdfa
rotate_pagesNoTurn pages that are upside down or sideways.
content_base64NoThe file content, base64-encoded. Up to 4 MB before encoding.

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.4/5.0
Behavior5/5

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

Annotations only declare a non-read-only, non-idempotent, non-destructive open-world call. The description adds the material behavior: API key required, 2 credits per page charged upfront and refunded on failure, a 15-minute job timeout, a 200-page cap, and 7-day result retention. Those are exactly the cost, durability and failure characteristics an agent must know before invoking a paid asynchronous job.

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?

Four short paragraphs, front-loaded with what the tool does, then inputs, then the follow-up call, then cost and limits. Nearly every sentence earns its place; the only minor waste is repeating the 4 MB base64 ceiling already stated in the schema.

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 paid async job tool with an output schema, the description covers what an agent needs: accepted formats, size and page ceilings, auth requirement, credit cost and refund policy, polling instructions, timeout, and retention. Return fields are enumerated but the output schema carries the detail, so nothing material is missing.

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 100%, so every parameter already carries its own description, including the 4 MB base64 limit and the enum meanings. The description mainly restates the two input paths and the filename requirement, adding only the 200-page/image-is-one-page bound, which is a document constraint rather than parameter meaning. Baseline 3 is appropriate.

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?

The opening sentence names a specific verb (queue), the resource (scanned PDF, PNG or JPEG) and the underlying engines (OCRmyPDF, Tesseract), plus the concrete outcome (same document with a searchable text layer). It also names the sibling get_ocr_result and the condition that selects it, so an agent can distinguish the two 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 Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It lays out the full workflow: submit via content_base64 (<=4 MB) or file (<=25 MB), then poll get_ocr_result with the returned job_id until status is succeeded or failed. That is explicit routing to the sibling with the terminating condition. It stops short of a when-not clause, but the mode parameter's skip default implicitly handles already-text PDFs.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources