Skip to main content
Glama

Read the text in an image with a vision model

ocr
Read-only

Reads the text of an image (JPEG, PNG, GIF or WEBP, up to 4 MB) with Llama 3.2 11B Vision on Workers AI. Send an https url or base64 image, and optionally a language hint. Returns the full text with its line breaks, the lines, a language guess and the model that answered. An image with no readable text is a 422 and is not charged. Price: $0.003 per successful call, paid with x402 (USDC on Base, Solana and 10 more networks); failed calls are not charged.

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": "ocr"
  }
}

Input Schema

NameRequiredDescriptionDefault
urlNohttps URL of the image
imageNoAlternative: the image as base64, up to 4 MB
languageNoOptional hint, e.g. English or German

Output Schema

NameRequiredDescriptionDefault
mimeNo
textNo
bytesNo
linesNo
modelNo
languageNo
checkedAtNo
languageNameNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "properties": {
      +    "bytes": {},
      +    "checkedAt": {},
      +    "language": {},
      +    "languageName": {},
      +    "lines": {},
      +    "mime": {},
      +    "model": {},
      +    "text": {}
      +  },
      +  "type": "object"
      +}
  2. Added

TDQS

A3.8/5.0
Behavior4/5

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

Adds substantial context beyond the readOnlyHint/openWorldHint annotations: the underlying model, the 4 MB ceiling, the 422 behavior for images without readable text, and per-call pricing with x402/USDC payment and the fact that failures are not charged. This is exactly the kind of operational detail annotations cannot convey. It stops short of describing rate limits or latency, keeping it off a 5.

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?

The purpose and input modes are front-loaded in the first sentence, with pricing and failure semantics following. It is a dense but single, well-ordered paragraph; the payment-network enumeration ('Solana and 10 more networks') is the only mildly expendable detail.

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 single-purpose OCR tool with an output schema already present, the description covers everything an agent needs: accepted formats, size limit, input modes, optional language hint, failure signal, and cost. It even summarizes the return shape (text, lines, language guess, model) without duplicating the schema in detail.

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 schema already documents url, image and language, including that they are alternative inputs and that language is an optional hint. The description restates this framing without adding syntax, format, or precedence rules (e.g., what happens if both url and image are sent), so the baseline 3 applies.

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?

States a specific verb and resource — 'Reads the text of an image' — plus supported formats (JPEG, PNG, GIF, WEBP, 4 MB) and the model used. The wording clearly frames this as text extraction rather than image description, which implicitly separates it from siblings like describe_image, though no sibling is named.

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?

It says how to call it ('Send an https url or base64 image, and optionally a language hint') and notes that text-free images return 422, which implies the appropriate input. However, there is no explicit when-to-use versus describe_image, and no statement of when this tool is the wrong choice.

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