Skip to main content
Glama

Agent Intel Invoice Document Ocr

agent_intel_invoice_document_ocr
Read-only

Extracts vendor name, tax ID, line items, net subtotal, VAT rates and payment details (IBAN, BIC) from an invoice image (PNG or JPEG, a public https URL or base64, up to 4 MB) sent straight to a Cloudflare Workers AI vision model. Model output is parsed as JSON and checked for the expected keys; unparseable output is an error, not a guess. Requires the env.AI binding. Price: $0.004 in USDC per successful call, paid with x402 (Base, Solana or Arc); failed calls are not charged.

Input Schema

NameRequiredDescriptionDefault
mimeNoWith imageBase64: image/png or image/jpeg (default image/png)
imageUrlNoPublic https URL of the invoice image (PNG or JPEG), up to 4 MB
imageBase64NoOr the image itself: base64 data (no data: prefix), up to 4 MB decoded

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changed
    • changedInput schema / properties / imageBase64 / description
      Previous value: -"Base64 image data (no data: prefix), up to 4 MB decoded"New value: +"Or the image itself: base64 data (no data: prefix), up to 4 MB decoded"
    • addedInput schema / properties / imageUrl
      Added value: +{
      +  "description": "Public https URL of the invoice image (PNG or JPEG), up to 4 MB",
      +  "type": "string"
      +}
    • changedInput schema / properties / mime / description
      Previous value: -"image/png or image/jpeg"New value: +"With imageBase64: image/png or image/jpeg (default image/png)"
    • removedInput schema / required
      Removed value: -[
      -  "imageBase64"
      -]
  2. First observed

TDQS

A4.5/5.0
Behavior5/5

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

Beyond the readOnlyHint/openWorldHint annotations, it discloses the runtime dependency (env.AI binding), the failure behavior ('unparseable output is an error, not a guess'), the size ceiling, and the exact cost model ($0.004 USDC per successful call via x402; failed calls not charged). These are behaviors an agent needs to sequence and budget calls correctly.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

One dense paragraph that front-loads the extracted fields, then inputs, then behavior, then cost. Every clause carries actionable information; the pricing and error-handling sentences in particular justify their length.

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?

With three optional parameters, an output schema present, and a caller that must know about the AI binding and the payment scheme, the description covers the prerequisites, limits, and failure mode without needing to explain return values. Nothing essential to a correct invocation 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 already defines imageUrl, imageBase64, and mime. The description restates the format and size constraints already present in the schema rather than adding new semantics such as mutual exclusivity rules or default behavior, so it lands at the baseline 3.

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 names a specific verb ('Extracts') and resource (invoice image fields: vendor name, tax ID, line items, net subtotal, VAT rates, IBAN, BIC). No sibling tool performs invoice OCR, so the agent can identify this tool's role from the name and first clause alone.

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 clearly states the applicable input conditions (PNG/JPEG, public https URL or base64, up to 4 MB) and the required env.AI binding, which tells the agent when the tool will work. It stops short of explicitly naming alternatives or exclusion cases (e.g., PDFs or local files), which keeps it from a 5.

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