Skip to main content
Glama
jcm4TX
by jcm4TX

ocr_pdf

Run OCR on scanned PDFs to add a searchable text layer using Tesseract, making the text copyable and searchable.

Instructions

Run OCR on a PDF to add a searchable text layer using Tesseract.

Use this when a PDF is scanned (no extractable text). After running, the output PDF has an invisible text layer and can be converted to markdown via markitdown, searched in Adobe / Windows Search, or copied from normally.

Args: input_path: Absolute path to the input PDF on the user's filesystem. output_path: Absolute path for the OCR'd output PDF. If omitted, defaults to "-ocr.pdf" in the same directory as input. language: Tesseract language code (e.g. "eng", "eng+spa", "deu"). Multiple languages are joined with "+". Default "eng". force_ocr: If True, OCR every page even if a text layer already exists. Use when the existing text layer is poor or junk OCR. Default False (pages with existing text are passed through unchanged). deskew: If True, straighten skewed pages before OCR. Default True.

Returns: A dict with success (bool), output_path (str on success), and error (str on failure).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
input_pathYes
output_pathNo
languageNoeng
force_ocrNo
deskewNo
Behavior4/5

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

No annotations provided, so description bears full burden. It explains the invisible text layer, return values, and parameter behaviors (e.g., force_ocr for existing layers, deskew). Lacks details about file overwriting or performance, but overall transparent.

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?

Well-structured with clear sections: purpose, usage, args, returns. Concise but not overly brief. A few phrases could be trimmed, but overall efficient.

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?

Given the complexity (5 params, no output schema), the description is complete. It explains the tool's function, when to use, all parameters with defaults, and the return format. An agent can confidently invoke this tool.

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

Parameters5/5

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

Schema coverage is 0%, so description must explain all parameters. It provides detailed Args section explaining each parameter's purpose, defaults, and nuances (e.g., 'force_ocr: Use when the existing text layer is poor or junk OCR'). Adds significant value beyond schema.

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?

Description clearly states the action: 'Run OCR on a PDF to add a searchable text layer using Tesseract.' It specifies the verb (Run OCR), resource (PDF), and outcome. Even without sibling tools, it makes the tool's purpose unambiguous.

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 states when to use: 'Use this when a PDF is scanned (no extractable text).' It also explains capabilities of output (searchable, convertible). Does not explicitly mention when not to use, but the condition is clear. Could mention alternatives, but none are listed as siblings.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/jcm4TX/ocrmypdf-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server