Skip to main content
Glama

Extract invoice fields and check the totals

invoice_extract
Read-only

Structured data from an invoice: seller and buyer (name, address, tax ID), invoice number, dates, currency, line items, subtotal, tax, total and payment details, with null for anything absent. The arithmetic is checked (line sum against subtotal, subtotal plus tax against total) and mismatches are returned. PDF with a text layer by URL or base64, or plain text. Price: $0.005 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": "invoice_extract"
  }
}

Input Schema

NameRequiredDescriptionDefault
urlNohttps link to a PDF invoice with a text layer (JSON body field)
textNoThe invoice text (JSON body field); or give url or pdf_base64 instead
pdf_base64NoThe PDF as base64, up to 15 MB (JSON body field)

Output Schema

NameRequiredDescriptionDefault
modelNo
checksNo
sourceNo
invoiceNo
checkedAtNo
disclaimerNo
allChecksPassNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.2/5.0
Behavior5/5

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

Beyond the readOnlyHint/openWorldHint annotations, the description discloses absent fields come back as null, that line-sum-vs-subtotal and subtotal-plus-tax-vs-total arithmetic is verified with mismatches returned, and full payment/charging semantics ($0.005 per successful call, x402 USDC, failed calls not charged). Pricing and payment preconditions are exactly the context structured fields cannot convey.

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?

Two sentences, both front-loaded: the return payload first, then validation, then input formats, then pricing. The long field enumeration earns its space because it defines the contract the caller is paying for. No redundant restatement of the title or annotations-only facts.

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?

An output schema exists, so return structure need not be explained, yet the description still usefully notes null-for-missing and mismatch reporting. For a three-param, open-world, paid extraction tool, the input constraints, failure-charging policy, and output guarantees are all covered.

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 the baseline is 3, but the description adds real meaning: it frames url/pdf_base64/text as alternative input modes and constrains PDFs to those with a text layer. The 15 MB base64 limit and the mutual exclusivity phrasing are left mostly to the schema, so it is not a 5.

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?

The description names a specific resource and enumerates the exact fields returned (seller/buyer identity, tax IDs, invoice number, dates, currency, line items, subtotal, tax, total, payment details), plus the arithmetic validation. That is far more specific than a generic 'extract' tool. It does not explicitly differentiate itself from sibling tools such as 'extract' or 'pdf', which keeps it at 4 rather than 5.

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?

Accepted input modes are stated clearly (PDF with a text layer via URL or base64, or plain text), which implies when the tool is applicable. However, there is no explicit when-to-use/when-not guidance and no routing to an alternative sibling when, for example, the PDF lacks a text layer or the caller wants generic extraction.

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