Skip to main content
Glama

photo_to_text

Photo to Text (OCR) — Extract text from an image via OCR. Language selection takes two-letter codes (en, fr, de, ...) separated by commas; Tesseract codes such as eng or chi_sim also work. [category: photo]

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
fileYesJPG, PNG, WebP, BMP, TIFF (max 15MB)
outputNojson returns structured results; text returns plain text.json
binarizeNoForce the picture to pure black and white before reading it. Off by default because it destroys text in uneven light; try it on faint or washed-out scans.
languagesNoWhich language or languages the writing is in. One code, or several separated by commas (en,fr); a plus sign works too, as Tesseract writes it (eng+fra). Two-letter codes are the usual form: en, fr, de, es, pt, it, nl, ru, ar, zh, ja, ko. Tesseract's own codes (eng, fra, deu, chi_sim, chi_tra, ...) are also accepted; each of the two reading engines is handed its own spelling of the language. A language whose reading pack is not installed on our server is refused with a message that says so, rather than reported as an engine fault. Letters and underscores only, not case-sensitive; a value with no code in it, such as a lone comma, is refused with a 400. Field name is languages, not language.en
preprocessNoApply image preprocessing before OCR.
binarize_thresholdNoThe cut-off between black and white, as a percent. Lower keeps more of the picture black. Only used when black and white is forced on; anything outside 1-99 quietly reverts to 60.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / properties / languages / description
      Previous value: -"Which language or languages the writing is in, as two-letter codes. One, or several separated by commas: en, or en,fr. Common ones are en, fr, de, es, pt, it, nl, ru, ar, zh, ja, ko. Field name is languages, not language, and Tesseract-style codes like eng are not recognised."New value: +"Which language or languages the writing is in. One code, or several separated by commas (en,fr); a plus sign works too, as Tesseract writes it (eng+fra). Two-letter codes are the usual form: en, fr, de, es, pt, it, nl, ru, ar, zh, ja, ko. Tesseract's own codes (eng, fra, deu, chi_sim, chi_tra, ...) are also accepted; each of the two reading engines is handed its own spelling of the language. A language whose reading pack is not installed on our server is refused with a message that says so, rather than reported as an engine fault. Letters and underscores only, not case-sensitive; a value with no code in it, such as a lone comma, is refused with a 400. Field name is languages, not language."
  2. Changed1 schema field changed
    • addedInput schema / properties / binarize_threshold / x-ui
      Added value: +{
      +  "unit": "%"
      +}
  3. Changed3 schema fields changed
    • addedInput schema / properties / binarize
      Added value: +{
      +  "default": false,
      +  "description": "Force the picture to pure black and white before reading it. Off by default because it destroys text in uneven light; try it on faint or washed-out scans.",
      +  "title": "Force black and white",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / binarize_threshold
      Added value: +{
      +  "default": 60,
      +  "description": "The cut-off between black and white, as a percent. Lower keeps more of the picture black. Only used when black and white is forced on; anything outside 1-99 quietly reverts to 60.",
      +  "maximum": 99,
      +  "minimum": 1,
      +  "type": "integer",
      +  "x-show-when": {
      +    "binarize": [
      +      "true"
      +    ]
      +  }
      +}
    • changedInput schema / properties / languages / description
      Previous value: -"Comma-separated ISO-639-1 codes, e.g. 'en' or 'en,fr'. Supported: en, fr, de, es, pt, it, zh, ja, ar, ru, ko, nl. Field name is 'languages' — not 'language'; Tesseract codes like 'eng' are NOT recognized."New value: +"Which language or languages the writing is in, as two-letter codes. One, or several separated by commas: en, or en,fr. Common ones are en, fr, de, es, pt, it, nl, ru, ar, zh, ja, ko. Field name is languages, not language, and Tesseract-style codes like eng are not recognised."
  4. First observed

TDQS

B3.2/5.0
Behavior3/5

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

The description discloses the core OCR behavior and mentions accepted language-code forms, which is useful. However, the annotations are all false and provide no safety profile, and the description does not state side effects, error behavior, or response format. Since this is a non-destructive extraction tool, the missing disclosures are not critical but remain gaps.

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 description is compact and front-loaded with the primary action, and the language note is useful before opening the schema. It loses a point for duplicating the title and ending with the low-value '[category: photo]' tag.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Together with the schema, the definition covers file formats, size limits, output modes, language syntax, preprocessing, and binarize behavior. A return schema and an explicit pointer to pdf_ocr would make it fully complete, but nothing needed to invoke the tool correctly is missing.

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 fully documents all 6 parameters. The tool description's language sentence adds minor readability at the tool level but does not add meaning beyond the detailed languages parameter description.

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?

Description begins with 'Extract text from an image via OCR', a specific verb and resource that clearly states what the tool does. It is partially differentiated from sibling tools by the 'image' resource, but it does not explicitly distinguish itself from pdf_ocr or other extraction tools.

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

Usage Guidelines2/5

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

No guidance is given on when to use photo_to_text versus alternatives such as pdf_ocr, pdf_to_text, or other photo tools. The only clue is the tool name and the word 'image', which is not enough to route an agent confidently among the many sibling tools.

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