Skip to main content
Glama

ai_receipt_extract

Read-only

Receipt to structured expense data — Turn store receipt text (OCR or pasted) into structured expense data: merchant, address, date, time, currency, line items (name, quantity, unit price, total), subtotal, tax and tax rate, tip, discount, total, payment method, card last 4 and an expense category (meals, groceries, travel, lodging, fuel, office, software, shipping, entertainment, health, other). The arithmetic is checked offline (items vs subtotal, subtotal + tax + tip - discount vs total) with verdict OK / REVIEW. Param: text (up to 8,000 characters). Workers AI llama-3.3-70b. Price: $0.008 USDC (Base, via x402).

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": {
      "text": "<text>"
    },
    "name": "ai_receipt_extract"
  }
}

Input Schema

NameRequiredDescriptionDefault
textYese.g. BLUE BOTTLE COFFEE 66 Mint St San Francisco CA 11/20/2026 08:14 Latte 2 x 5.50 11.00 Croissant 4.25 Subtotal 15.25 Tax 1.37 Tip 3.00 Total 19.62 VISA ****4821

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A3.8/5.0
Behavior4/5

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

Annotations already cover safety (readOnly, non-destructive, open-world), and the description adds genuinely new behavioral context: the underlying model (Workers AI llama-3.3-70b), a concrete price ($0.008 USDC on Base via x402), an 8,000-character input cap, and the fact that arithmetic is validated with an OK/REVIEW verdict. It stops short of describing what happens on unparseable input or whether REVIEW still yields usable data.

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 is front-loaded in the opening clause, with field list, verification behavior, constraints, model, and price following in descending order of usefulness. The long parenthetical enumerations of fields and categories are dense but each maps to actual output the caller will receive, so little is wasted.

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 no output schema, the description correctly carries the burden of describing return content, listing every extracted field plus the arithmetic verdict, and it adds cost and input limits an agent needs before calling. It leaves unstated the response encoding (JSON shape) and error behavior for non-receipt text, which keeps it from fully 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% and there is only one parameter, so the baseline is already high. The description still adds real value the schema lacks: the 8,000-character limit is not encoded in the schema, and noting that input may be raw OCR output clarifies tolerance for noisy text.

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 — turning receipt text into structured expense data — and enumerates the exact fields produced (merchant, line items, tax, total, payment method, category), which is far more specific than the title alone. It is implicitly distinguishable from document-extraction siblings by the word "receipt," but it never names those siblings or explicitly rules out invoices/contracts.

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 makes the input mode clear ("OCR or pasted" receipt text, capped at 8,000 characters), which is usable context for selecting it. However, it gives no when-not guidance and never routes the caller to ai_invoice_extract or ai_extract for adjacent document types, leaving the choice to inference from the name.

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