Skip to main content
Glama

ocr_document

Read-onlyIdempotent

Convert scanned PDFs and images (PNG, JPEG, WebP, BMP, TIFF) into recognised text per page when files have no embedded text layer.

Instructions

OCR a scanned PDF or image (PNG/JPEG/WebP/BMP/TIFF) and return the recognised text per page. Use this when a PDF has no embedded text layer (convert_pdf_to_markdown will tell you) or when extracting text from screenshots, photos of documents, receipts and forms. Limited to 30 pages per call — narrow with 'pages'.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlNoPublic http(s) URL of the document to fetch and convert. Leave empty when passing file_base64 instead.
pagesNo1-based page selection like '1,3-5'. Empty means all pages.
filenameNoOriginal filename with extension (e.g. 'report.docx'). Used as a format hint when content type cannot be detected automatically.
passwordNoPassword for encrypted PDFs. Empty for normal files.
file_base64NoBase64-encoded file content (for documents not reachable by URL). Decoded size limit: 30 MB. Leave empty when passing url instead.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.2.0

TDQS

A4.3/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=true, idempotentHint=true, and destructiveHint=false, so the safety profile is covered. The description adds the 30-page-per-call limit and per-page return behavior, which is useful, but it does not mention failure modes, language support, or rate limits. Given the strong annotation coverage, this is a moderate addition.

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?

The description is three sentences with no filler. It front-loads the core operation and supported inputs, then gives usage context and a clear page limit. Every sentence earns its place.

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 a tool with no output schema, the description adequately explains the return value ('recognised text per page'), supported input formats, and the page cap. The full parameter schema and sibling context fill the remaining gaps, so nothing critical is missing for correct invocation.

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 description coverage is 100%, so the schema already documents all five parameters including url, pages, filename, password, and file_base64. The description adds only the 30-page cap and advice to narrow with 'pages', which is helpful but not a substantial semantic expansion beyond the 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?

The description uses a specific verb ('OCR') and names exact input types (scanned PDF, PNG/JPEG/WebP/BMP/TIFF) as well as the output ('recognised text per page'). It clearly distinguishes itself from PDF-to-markdown conversion by targeting scanned/no-text-layer documents and images.

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?

The description explicitly states when to use the tool: when a PDF has no embedded text layer or when extracting text from screenshots, photos, receipts, and forms. It also names the sibling tool convert_pdf_to_markdown as the diagnostic alternative and gives a concrete operational constraint (30-page limit, narrow with 'pages').

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