Skip to main content
Glama

OCR (offline)

pdf_ocr

Add an invisible OCR text layer to scanned PDFs using local Tesseract traineddata, returning recognition counts and confidence without extracted text.

Instructions

Add an invisible text layer to a scanned PDF using tesseract with locally installed traineddata. Done for: eng, rus. Recognised text is not returned, only counts and confidence.

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": {
      "path": "<path>"
    },
    "name": "pdf_ocr"
  }
}

Input Schema

NameRequiredDescriptionDefault
outNo
pathYes
langsNo
pagesNo1-based page numbers. Omit for all pages.
scaleNorender scale before OCR, default 2

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.4

TDQS

B3.2/5.0
Behavior3/5

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

With no annotations at all, the description carries the full burden. It usefully discloses that processing is offline with locally installed traineddata and that the output is a text layer rather than returned text, but it never says whether the source PDF is modified in place or a new file is written, nor whether an existing `out` file is overwritten.

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?

Three short sentences, front-loaded with the core action, and no padding. The fragment 'Done for: eng, rus' is grammatically awkward and its meaning (tested? supported?) is slightly ambiguous, which keeps it from a 5.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 5-parameter mutation tool with no annotations and no output schema, the description does cover the return shape (counts and confidence) and the offline constraint, which are the highest-value facts. It is still incomplete on write semantics, which is the main risk an agent needs resolved before calling it.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is only 40%, so the description needs to compensate and largely does not. It says nothing about `out` (output path vs in-place write), `scale`, or `pages`, and its language note ('Done for: eng, rus') merely restates the enum already present in the schema.

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 ('Add an invisible text layer to a scanned PDF') plus the underlying engine (tesseract), and the clause 'Recognised text is not returned' implicitly separates it from pdf_extract_text. It stops short of naming that sibling, so the differentiation is inferred 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?

Use on a 'scanned PDF' is implied as the target case, and the note that text is not returned steers agents away from using this to obtain text. There is no explicit when-not guidance, no mention of prerequisites (tesseract installed? traineddata present?), and no named alternative for actually extracting text.

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