Skip to main content
Glama

extract_document

Extract STRUCTURED FIELDS from a document image: invoices, receipts, ID cards — or any custom JSON schema you supply. Every field returns {value, confidence, box} where the confidence and box come from the OCR geometry (never model guesswork); absent fields are null. preset="zatca" additionally decodes the Saudi ZATCA e-invoice QR (TLV) and cross-validates it against the printed fields — use it for Saudi tax invoices. Arabic-first accuracy. 5 credits/page (zatca 7).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
langNoLanguage hint; default auto.auto
presetNoBuilt-in schema. Use zatca for Saudi e-invoices (adds QR validation).
schemaNoCustom extraction schema instead of a preset: an object whose keys are the fields you want, values describing them, e.g. {"policy_number": "string|null"}.
api_keyNoOptional Auto-Reader OCR key (nsk_live_...). If omitted, a free trial key is auto-provisioned and returned to you in the result.
image_base64YesThe document image as base64 (data: URI prefix accepted).

TDQS

A4.3/5.0
Behavior4/5

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

No annotations provided, so description must fully disclose behavior. It details the return format ({value, confidence, box}), states that confidence/box come from OCR geometry rather than model guesswork, explains zatca's QR decoding and cross-validation, mentions Arabic-first accuracy, and specifies credit costs. These are important behavioral traits beyond a simple read operation.

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 moderately concise with no redundant sentences. It front-loads the purpose and then provides key details in a logical flow. Slightly dense but each sentence contributes value.

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?

Given no output schema, the description adequately explains the return format. It covers presets, custom schemas, language hint, API key, and cost. Missing details like supported image formats or size limits, but for a tool with a clear schema and description, it is fairly complete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so baseline is 3. The description adds significant meaning beyond schema: it explains the return format for fields and the special behavior of preset='zatca' (QR decoding and cross-validation). This helps the agent understand what 'fields' means and when to use the zatca preset.

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 clearly states it extracts structured fields from document images, listing specific document types (invoices, receipts, ID cards) and custom schemas. The verb 'Extract STRUCTURED FIELDS' clearly differentiates it from raw OCR sibling tools like ocr_image, implying extraction of specific data rather than full text.

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?

The description provides clear guidance on when to use each preset, especially for Saudi tax invoices with zatca. It also mentions custom schemas. However, it lacks explicit comparison to sibling tools like ocr_and_translate or ocr_image, leaving the agent to infer the structured vs raw OCR distinction.

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.

TDQS

A4.3/5.0
Disambiguation5/5

Each tool has a clear, distinct purpose: key provisioning, structured extraction, usage checking, combined OCR+translation, plain OCR, and translation. No overlap that would confuse an agent.

Naming Consistency5/5

All tool names follow a consistent verb_noun pattern with underscores (e.g., create_api_key, ocr_image, translate_text). Even the compound name 'ocr_and_translate' fits the pattern.

Tool Count5/5

With 6 tools, the server is well-scoped for an OCR service, covering key management, usage monitoring, multiple OCR modes, structured extraction, and translation without being over-fragmented.

Completeness4/5

The tool set covers core OCR workflows well, but lacks a tool for revoking API keys or listing existing keys, which is a minor gap for full lifecycle management.