Skip to main content
Glama

OCR an image to text (Tesseract)

job_ocr_tesseract

Extracts the printed text from one image (PNG, JPEG, TIFF or WebP, sent as base64) with Tesseract OCR 5, English, and reports Tesseract's mean word confidence. Use it for scans, screenshots, photos of printed pages or receipts, and scanned PDF pages saved as images. Use job_doc_to_markdown instead for a PDF or Office file that already has a text layer. Cost: at most $0.00003134 per call (measured CPU time), debited from your balance; an empty result or failed run is free. Auth: Authorization: Bearer (POST https://api.gaents.com/v1/accounts, $0.10 free credit); with no key the call returns a signed 402 quote payable in BSV or USDC via x402. Errors (isError, error.code): 400 missing_param/bad_param, 401 bad_api_key, 402 low balance, 429 busy (retry in seconds), 503 job_unavailable, 502 job_failed (refunded).

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": {
      "image_b64": "<image_b64>"
    },
    "name": "job_ocr_tesseract"
  }
}

Input Schema

NameRequiredDescriptionDefault
langNoOCR language; only eng (English) is installed. Default eng.
image_b64YesThe image file's bytes, base64-encoded (PNG, JPEG, TIFF or WebP), no data: prefix. (at most 3000000 bytes decoded)

Output Schema

NameRequiredDescriptionDefault
emptyYestrue = nothing found, not charged
outputYes{text, chars, mean_confidence (0-100), lang, width, height}
sourceNo
chargedNo
measuredNowall seconds of this run
charged_usdYes
receipt_quote_idYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "properties": {
      +    "charged": {
      +      "type": "boolean"
      +    },
      +    "charged_usd": {
      +      "type": "number"
      +    },
      +    "empty": {
      +      "description": "true = nothing found, not charged",
      +      "type": "boolean"
      +    },
      +    "measured": {
      +      "description": "wall seconds of this run",
      +      "type": "object"
      +    },
      +    "output": {
      +      "description": "{text, chars, mean_confidence (0-100), lang, width, height}",
      +      "properties": {
      +        "chars": {},
      +        "height": {},
      +        "lang": {},
      +        "mean_confidence": {
      +          "description": "0-100"
      +        },
      +        "text": {},
      +        "width": {}
      +      },
      +      "type": "object"
      +    },
      +    "receipt_quote_id": {
      +      "type": "string"
      +    },
      +    "source": {
      +      "type": "object"
      +    }
      +  },
      +  "required": [
      +    "output",
      +    "empty",
      +    "charged_usd",
      +    "receipt_quote_id"
      +  ],
      +  "type": "object"
      +}
  2. Changed8 schema fields changed
    • addedInput schema / additionalProperties
      Added value: +false
    • addedInput schema / properties / image_b64 / contentEncoding
      Added value: +"base64"
    • changedInput schema / properties / image_b64 / description
      Previous value: -"the image file, base64 (PNG/JPEG/TIFF/WebP)"New value: +"The image file's bytes, base64-encoded (PNG, JPEG, TIFF or WebP), no data: prefix. (at most 3000000 bytes decoded)"
    • addedInput schema / properties / image_b64 / examples
      Added value: +[
      +  "iVBORw0KGgoAAAANSUhEUgAAASwAAAAwAQAAAACDZXqMAAAB70lEQVR42u2VsU5UQRSGvxk2cIvN7sQKza6cGB7AggIbuSYWdL6C+ATGxBgrBkNB5xsohQ+x5TUhgYJEY6vRI0SzHYuhmDUwx8KFvQEkxNiYcKqZ5Jt/zpn/5IwzLhH7nkvFFfb/Yf0+YOECbMh7UAVyugBzVCACHJ7Bfo4xY/6PIqmutjW61J3BiuNFA6MEATjbyGmyntuwhCOh334yLPthA1bX38Zh2Q97YWXEWbJ32t7cHExZ1Sy1vTHlzHgdZ7S9MaFtls3MBh5Hb7cnsv+JOz++7Pa6H59hd+PCYLfX/Xx9b+GkUre23UG/t7As252d1mrM9yirZmcnJMpYcyGoAM4Ds6N6UxVmiyKPzbIqZNGiwHIZggJEvi6SleSrcaU9PFIZzhOzFABxPQUvVrA1dmFxqaVaOiwTvSbPIbysllrqkntee7eI1NQyDWIoIkLBw/JErZzJ6LzDMo+9JiAuS5rJaombx2Y5egUqmiadh4HgIYpsgbii3iGLIApYBrTIsIwmqLWDx1HNHSA3PuA8c28kgX8VbW3uQMyOjsZqZTeotu9jme6aFh73LT6a7wZ1XGuU49yeNoXmNM4zfVvSBLzo3HrQaQqTzv02y50/LUX/5bSUU/vGeZDly6mN6qufPC9WTu0H7upf+CvsF9+I7SoYYIcEAAAAAElFTkSuQmCC"
      +]
    • changedInput schema / properties / lang / description
      Previous value: -"traineddata language (installed: eng)"New value: +"OCR language; only eng (English) is installed. Default eng."
    • addedInput schema / properties / lang / examples
      Added value: +[
      +  "eng"
      +]
    • addedInput schema / properties / lang / maxLength
      Added value: +20
    • addedInput schema / properties / lang / minLength
      Added value: +1
  3. Added

TDQS

A4.7/5.0
Behavior5/5

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

Beyond the annotations, the description discloses billing behavior, the exact maximum cost, refunds for empty or failed runs, authentication details, the x402 fallback, and specific error codes and states. It is also consistent with the annotations: the tool is not presented as read-only, and billing makes the non-idempotent/non-destructive annotation profile plausible.

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 definition is front-loaded: purpose first, then usage guidance and alternative, then cost/auth/errors. Although information-dense, every section helps an agent decide whether and how to call the tool correctly.

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 two-parameter OCR tool with an output schema, the description covers accepted inputs, scope, alternative tools, cost, authentication, and error behavior. It is complete enough that an agent would not need to guess about invocation prerequisites or failure handling.

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 coverage is 100%, so the input schema already explains image_b64 base64 encoding, accepted formats, size limit, and that lang is English-only with enum [eng]. The description reinforces English-only OCR and image formats, but adds little parameter meaning beyond the structured 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 gives a specific verb and resource: extracts printed text from one image using Tesseract OCR 5, reports mean word confidence, and accepts PNG/JPEG/TIFF/WebP. It explicitly distinguishes itself from job_doc_to_markdown for PDFs or Office files with a text layer.

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?

It names concrete use cases such as scans, screenshots, photos of printed pages, receipts, and scanned PDF pages saved as images, and it routes PDFs/Office files with a text layer to job_doc_to_markdown instead.

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