Skip to main content
Glama

Extracts vendor name, tax ID, line items, net subtotal, VAT

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 per successful call, paid with x402 (USDC on Base, Solana and 10 more networks); failed calls are not charged.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "agent_intel_invoice_document_ocr"
  }
}

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.3/5.0
Behavior5/5

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

Beyond the readOnlyHint/openWorldHint annotations, it discloses what happens on failure (unparseable model output is an error rather than a guess), that failed calls are not charged, the exact cost ($0.004 per successful call), and the payment rails (x402, USDC on Base/Solana). This is exactly the operational context an agent needs before committing a paid external call.

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 purpose and input constraints are front-loaded in the first sentence, with cost and failure semantics trailing, so scanning order is sensible. The payment sentence is somewhat dense (network enumeration, per-call pricing) but every clause carries information an agent could act on.

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?

With an output schema present and annotations covering the read-only/open-world profile, the description's job is limited to inputs, cost, and failure mode — all covered. The only shortfall is that it never states the URL/base64 exclusivity rule, which matters given zero required parameters.

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 documents mime, imageUrl, and imageBase64 including the 4 MB limit and the no-prefix base64 rule. The description largely restates those constraints rather than adding new meaning, and it does not clarify the implicit requirement that exactly one of imageUrl or imageBase64 be supplied (all three params are optional). Baseline 3 applies.

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 opens with a specific verb and resource — extracting named fields (vendor name, tax ID, line items, net subtotal, VAT rates, IBAN/BIC) from an invoice image — which is unmistakable and shares no overlap with the blockchain/security siblings listed. The exact output fields and the source artifact are stated up front, so an agent knows precisely what operation it is selecting.

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 concrete preconditions for use: PNG or JPEG only, a public https URL or base64 payload, 4 MB ceiling, and a required env.AI binding plus x402 payment. What it does not do is state when NOT to use it or name any alternative tool, but no sibling in this catalog performs OCR, so the practical gap is small.

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