Skip to main content
Glama

OCR Document Scan Prompt (0.07 credits)

ocr_scan_gpt

Reads an identity document photo using OCR and returns extracted fields such as name and document number for the selected document type and optional country.

Instructions

Reads an identity document from a photo. Returns the extracted fields for the document type, such as name and document number. Inputs: documentType, image (base64 or https URL), and an optional country. Use this general OCR. Use ocr_scan_studio for the studio reader and mexico_api_ine_ocr for an INE card. Costs 0.07 credits per successful call.

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": {
      "documentType": "<documentType>",
      "image": "<image>"
    },
    "name": "ocr_scan_gpt"
  }
}

Input Schema

NameRequiredDescriptionDefault
imageYesFace or document photo as a base64-encoded JPEG/PNG string (with or without a data:image/...;base64, prefix) or a public https:// image URL.
countryNoOptional ISO country code to select the document template.
documentTypeYesDocument type code for the GPT OCR template. Common values: CC, CC_BACK, CCVE, DNI, DNIES, PA, RUT, ENSAPA, RIFVE, TLCC, TLCC_FULL. Use an exact code supported by your template — invalid codes may fail.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.5

TDQS

A4.1/5.0
Behavior4/5

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

Annotations already declare openWorldHint and non-idempotency, so the description's real contribution is the metered-cost disclosure (0.07 credits per successful call) and the accepted image encodings (base64 with or without data: prefix, or https URL). It does not mention credential/auth needs or failure/retry behavior, which for an external paid API would be useful.

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?

Four short sentences, front-loaded with purpose, then return value, inputs, routing, and cost — no filler. Minor redundancy in restating the three input names that the schema already documents.

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?

For a three-parameter OCR call with no output schema, the description covers what is returned at a field level, accepted input formats, alternatives, and cost. Missing are error modes (invalid documentType codes are only hinted at in the schema) and whether results are stored or just returned.

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% and every parameter is fully described there, including the document-type codes, so the baseline of 3 applies. The description's recap of documentType/image/country adds no syntax or constraint the schema does not already carry, though it does usefully flag country as optional.

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?

States a specific verb and resource ("Reads an identity document from a photo") and immediately names the return shape (extracted fields such as name and document number). It also explicitly separates itself from ocr_scan_studio and mexico_api_ine_ocr, so an agent can pick it without opening a schema.

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

Usage Guidelines4/5

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

It gives a positive routing rule ("Use this general OCR") plus two named alternatives with their distinguishing condition (studio reader, INE card). The only gap is that "studio reader" is not defined, so the boundary between general OCR and studio OCR is only partially inferable.

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

Deploy Server

Other Tools