Skip to main content
Glama

doc_tools_ocr

Text recognition for scans, photos of documents, screenshots and scanned PDFs: the text in reading order, each line with its page, position and confidence. English and other Latin-script text; small or soft images are enlarged first. Price: $0.03 USDC via x402, charged only on success. Part of Document tools: Work with PDFs and scans: read the text out of a PDF with page numbers and metadata, recognize the text in a scan, photo or screenshot, merge PDFs, take or reorder pages, split into parts, and turn images into a PDF..

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "doc_tools_ocr"
  }
}

Input Schema

NameRequiredDescriptionDefault
pdfNoOr a scanned PDF as base64: its pages are drawn and read one by one.
imageNoImage as base64: a scan, a photo of a document, a screenshot (PNG, JPEG, WebP, TIFF).
pagesNoFor a PDF: pages to read, like "1-3". The first 10 when omitted; up to 15 per call.
layoutNoauto finds columns and paragraphs; single-block for one plain block of text; single-line for a label or a number; sparse for text scattered over a picture (UI, signs).auto
pdfUrlNo
imageUrlNo
minConfidenceNoDrop lines the engine is less sure of than this (0 to 100).

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changed
    • addedInput schema / properties / pages
      Added value: +{
      +  "description": "For a PDF: pages to read, like \"1-3\". The first 10 when omitted; up to 15 per call.",
      +  "maxLength": 100,
      +  "type": "string"
      +}
    • addedInput schema / properties / pdf
      Added value: +{
      +  "description": "Or a scanned PDF as base64: its pages are drawn and read one by one.",
      +  "type": "string"
      +}
    • addedInput schema / properties / pdfUrl
      Added value: +{
      +  "format": "uri",
      +  "type": "string"
      +}
  2. Added

TDQS

B3.1/5.0
Behavior2/5

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

With no annotations supplied, the description carries the full behavioral burden. It does contribute real context — $0.03 USDC via x402 charged only on success, Latin-script-only support, and pre-enlargement of small or soft images — but it never says whether exactly one of pdf/image/pdfUrl/imageUrl must be supplied, what happens if several are given, or what a failure looks like.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The opening sentence is well front-loaded and dense with useful facts, but the trailing "Part of Document tools: ..." catalog blurb burns several lines restating sibling capabilities that do not help invoke this tool. The doubled period also signals unedited generated text.

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?

Return content is described (text in reading order, each line with page, position and confidence), which usefully substitutes for the absent output schema. However, for a 7-parameter tool with zero required fields and four mutually alternative input channels, the definition should state the input-selection rule and it does not.

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 71%, so the schema already explains pages, layout and minConfidence in detail. The description adds only indirect meaning (reading order, the enlargement preprocessing), and crucially leaves the pdf vs image vs URL selection ambiguity to the schema, which does not resolve it.

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?

"Text recognition for scans, photos of documents, screenshots and scanned PDFs" gives a specific verb+resource, and the mention of scanned PDFs implicitly separates it from doc_tools_pdf_text, which reads text out of a PDF. It stops short of explicitly naming that sibling or stating the boundary, so an agent still has to infer which PDF tool to pick.

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?

Usage is implied by the input list (images, photos, screenshots, scanned PDFs) rather than stated as a rule, and no alternative tool is named as the choice for text-layer PDFs. The only explicit constraint is the language limitation to English and other Latin-script text.

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