Skip to main content
Glama

Scan Single Document to Structured JSON

scan_document
Read-onlyIdempotent

Extract schema-validated JSON from supported documents—including IDs, invoices, receipts, and vehicle records—by routing each uploaded file to a specialized OCR endpoint.

Instructions

Extract schema-validated JSON from any of 19 specialized StructOCR single-document endpoints (1-3 credits depending on document type; supports JPG, PNG, WebP, HEIC, and PDF up to 4.5 MB — driver_license_pdf417 accepts JPG, PNG, WebP, HEIC). Zero Data Retention applies automatically on driver_license_pdf417, health_card, proof_of_address, and visa.

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": {
      "document_type": "<document_type>",
      "file": "<file>"
    },
    "name": "scan_document"
  }
}

Input Schema

NameRequiredDescriptionDefault
fileYesLocal file path, base64 string, or data URL of the document (max 4.5 MB).
accuracyNoReceipt OCR only: "standard" (1 credit, default) or "enhanced" (2 credits).
document_typeYesTarget document type: driver_license_pdf417 (2cr, zero-retention), driver_license (2cr), passport (2cr), national_id (2cr), health_card (2cr, zero-retention), proof_of_address (2cr, zero-retention), visa (2cr, zero-retention), vin (1cr), vin_pro (2cr), license_plate (1cr), vehicle_registration (2cr), auto_insurance (2cr), invoice (3cr, up to 5 PDF pages), receipt (1cr standard / 2cr enhanced), container (1cr), bill_of_lading (3cr), weighbridge_ticket (2cr), atm_cassette (1cr), hin (1cr).
response_versionNoReceipt OCR only: optional response schema version.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A3.5/5.0
Behavior4/5

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

Annotations already cover the safety profile (readOnly, idempotent, non-destructive, openWorld), so the bar is lower, and the description still adds real substance: credit cost per type, file-size limits, PDF page caps, and which four types get automatic Zero Data Retention. It does not say whether failed or rejected extractions still consume credits, nor how errors surface.

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?

It is a single ~60-word sentence with nested parentheticals and semicolon-separated asides, which front-loads the core action but makes the constraints harder to scan. Nothing is strictly wasteful, but the packed structure works against readability.

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?

With no output schema and 19 divergent document types, the description asserts 'schema-validated JSON' without characterizing what the shape looks like or whether it varies per document_type. For a tool this broad, a brief note on return structure would close the remaining gap.

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 enum for document_type already documents per-type costs, page limits, and zero-retention flags, and file/accuracy/response_version are described in-schema. The description largely restates that same cost and retention information rather than adding meaning the schema lacks, so 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 ('Extract schema-validated JSON') and scopes it to 'single-document endpoints' among 19 StructOCR types, which implicitly contrasts with multi-document or PDF-batch siblings. It never names an alternative tool, so the differentiation from extract_pdf or image_to_excel is left to inference rather than stated.

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?

The description gives hard operational boundaries (formats, 4.5 MB cap, 1-3 credits, PDF page limits for invoice) that imply eligibility, but it never states when to pick this over list_supported_documents, verify_driver_license, or extract_pdf. Usage is inferable from the endpoint list rather than explicitly guided.

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