Skip to main content
Glama

OCR a scanned PDF

pdf_ocr

Run OCR over a scanned PDF and return a searchable PDF with an added text layer (Tesseract engine). Processing takes roughly 30-90 seconds depending on length. Use this when the user asks to make a scanned PDF searchable or extract text from scans.

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": "pdf_ocr"
  }
}

Input Schema

NameRequiredDescriptionDefault
fileYesBase64-encoded file bytes (no data: URL prefix).
langNo
filenameNoOriginal file name including extension.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.2/5.0
Behavior4/5

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

Goes beyond the annotations by disclosing the engine (Tesseract), the expected latency (30-90 seconds), and the shape of the result (a new PDF with an added text layer rather than an in-place edit). This is useful context that the readOnly/destructive hints alone don't convey. It still doesn't say what happens on failure or how the output file is returned.

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?

Two sentences, zero padding: the first defines the operation and its output, the second gives the trigger and the latency. The purpose and the when-to-use are both front-loaded.

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?

With no output schema, the description carries the return-value burden and does so by naming the searchable-PDF result, plus timing expectations. The only real gap is the unexplained lang parameter and any input constraints, but for a straightforward single-operation tool this is nearly complete.

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 67%; 'file' and 'filename' are documented, but 'lang' has no schema description and the description never mentions language selection. The description adds no parameter-level detail, so the undocumented lang parameter remains opaque. Baseline 3 is appropriate given partial schema coverage.

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 ('Run OCR over a scanned PDF') plus the exact output ('searchable PDF with an added text layer') and names the engine. An agent can distinguish it from pdf_extract_text, which reads text rather than producing a searchable file.

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?

Explicitly gives the triggering condition: 'Use this when the user asks to make a scanned PDF searchable or extract text from scans.' It doesn't name a when-not case or point to a specific alternative sibling, but the scanned-PDF qualifier implicitly separates it from pdf_extract_text.

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