Skip to main content
Glama

PDF Efforts

OCR (make scans searchable)

ocr_pdf
Idempotent

Recognize text in a scanned PDF or an image with Tesseract (self-hosted). Output a searchable PDF (invisible text layer) or plain text. Up to 50 pages; about 3-10 seconds per page.

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
fileYesThe scanned PDF or image (JPG, PNG, WEBP, GIF, BMP).
outputNo"pdf" = searchable PDF, "txt" = plain text (also returned inline).pdf
languageNoTesseract language code of the document.eng

Output Schema

NameRequiredDescriptionDefault
infoNoFacts about the PDF (get_pdf_info) or the result (e.g. target_met for compress_pdf).
noteNoAnything the user should know about the result.
textNoExtracted text (pdf_to_text, ocr_pdf).
filesYesResult files. Download them before expires_at; pass file_id to another tool to chain.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A3.8/5.0
Behavior4/5

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

Beyond the annotations, the description discloses operational traits the agent actually needs: the 50-page cap, the 3-10 seconds per page cost, self-hosted Tesseract, and that the PDF output carries an invisible text layer while txt is also returned inline. That is substantive planning context not present in the structured fields.

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 short sentences: capability, outputs, then cost limits. No boilerplate or repetition, and the most decision-relevant facts come first. Nothing here could be cut without losing information.

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 a 100%-documented schema, an output schema, and full annotations, the description only needs to add cost/limit context, which it does. The one remaining gap is that it never hints at reuse of file_id results or which image formats are accepted, though both are covered by the schema.

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 file, output, and language are fully documented in the schema; the description only echoes the output enum semantics (searchable PDF vs plain text). It adds nothing about the language codes or the file-sourcing options, which is acceptable at this coverage level but not value-adding.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description gives a specific verb and resource ("Recognize text in a scanned PDF or an image") plus the engine and output form, and the word "scanned" implicitly separates it from text-extraction siblings like pdf_to_text. It stops short of naming a sibling explicitly, so the differentiation is inferential rather than stated.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

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

Saying it works on a "scanned PDF or an image" implies the condition for use (no embedded text layer), but there is no explicit when-to-use/when-not statement and no reference to pdf_to_text for already-digital documents. An agent must infer the boundary itself.

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