Skip to main content
Glama

OCR (image or scanned PDF to text)

ai_ocr
Read-onlyIdempotent

Extract text from images and scanned PDFs offline in English or Arabic, returning page text and mean word confidence without uploading files.

Instructions

Read the text in an image (PNG, JPEG, WebP, TIFF incl. multi-page, GIF, AVIF) or a scanned PDF with Tesseract (tesseract.js), fully offline: the English and Arabic models ship with the server and nothing is downloaded or uploaded. Languages: "eng", "ara" or "eng+ara" (default). PDF pages are rendered at 200 dpi by default. Returns the text per page and the mean word confidence (0-100); give "output" to also write a .txt file. Limits: up to 200 pages per call, roughly 1-5 s per page; printed text works well, handwriting and very small or skewed text poorly. For PDFs that already have a text layer, pdf_to_text is faster and exact. Give "file" as a local path or base64.

Input Schema

NameRequiredDescriptionDefault
dpiNoRender resolution for PDF pages. Default 200.
psmNoPage layout: "auto" (default), "block" (one uniform block), "line", "word", or "sparse" (scattered text).auto
fileYesThe image or PDF: a local file path (absolute, or relative to the server's --root) or base64 data (raw or a data: URI).
pagesNoPDF pages / TIFF frames, e.g. "1-3, 5" (default all).
outputNoAlso write the text to this .txt file (or folder ending in "/").
perPageNoAlso return the text of each page separately in "pages". Default false (the joined "text" has page separators).
maxCharsNoCut the inline text after this many characters (the file is never cut).
languagesNoLanguages to read. Default "eng+ara".eng+ara

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.8/5.0
Behavior5/5

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

Annotations already establish readOnly/idempotent/closed-world, but the description adds substantial context beyond them: fully offline operation with bundled eng/ara models, nothing downloaded or uploaded, PDF pages rendered at 200 dpi by default, and the fact that "output" writes a side-effect .txt file while inline text can be truncated by maxChars. It also discloses performance and accuracy characteristics, which annotations cannot convey.

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?

Everything is front-loaded — capability, formats, then languages/dpi/returns, then limits and the sibling alternative — and almost every clause carries information. It is a dense single block rather than scannable sentences, which slightly hurts readability for an agent parsing quickly.

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 an 8-parameter tool with no output schema, the description still covers the return shape (text per page plus mean word confidence 0-100), the file-writing side effect, resource limits, and the closest alternative. Nothing an agent needs to invoke it correctly is missing.

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

Parameters4/5

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

Schema coverage is 100%, so baseline would be 3; the description still adds value by restating the language set and default ("eng", "ara", "eng+ara"), the 200 dpi render default, and by clarifying that "file" accepts either a local path or base64 and that "output" writes a .txt file. The psm, pages, perPage, and maxChars parameters are left entirely to the schema, which keeps it just short of a 5.

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 (read/extract text) and resource (image or scanned PDF) and names the engine (Tesseract/tesseract.js). It also enumerates supported formats and explicitly distinguishes itself from the pdf_to_text sibling, so an agent can route correctly without opening the schema.

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

Usage Guidelines5/5

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

Gives an explicit alternative and the condition that selects it: "For PDFs that already have a text layer, pdf_to_text is faster and exact." It also frames suitability (printed text works well, handwriting and small/skewed text poorly) and hard limits (200 pages, ~1-5 s/page), which is exactly the when-to-use/when-not guidance an agent needs.

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

Deploy Server

Other Tools