Skip to main content
Glama

parse.invoice

Read-onlyIdempotent

Parse a tax invoice or commercial invoice into the AfricaInvoiceReceipt contract: seller (TIN / KRA PIN / VAT no), issued date, currency, line items, VAT rate/amount, subtotal, total, payment refs, confidence, and warnings (including vat_total_mismatch). Built for NG/KE/GH/ZA AP automation and multi-line SKU invoices — not a thin keyword grep. Use when the document is an invoice rather than a till slip; still accept OCR text or image/PDF base64. Nulls mean unknown; do not treat low-confidence totals as ledger truth without checking confidence and warnings. Costs $0.15 (15 credits) pay per call; see the billing note for failed calls; prepaid credits or x402.

Input Schema

NameRequiredDescriptionDefault
textNoOCR or plain-text dump of the tax invoice. Example: 'TAX INVOICE\nDANGOTE CEMENT PLC\nTIN: 01012345-0001'
tierNoProcessing tier. Example: autoauto
filenameNoOriginal filename hint. Example: invoice.pdf
file_base64NoPDF or image bytes as base64
content_typeNoMIME type of file_base64. Example: application/pdf

Output Schema

NameRequiredDescriptionDefault
taxYes
buyerNo
totalYes
paymentNo
currencyYes
doc_typeYes
merchantYes
subtotalYes
warningsYes
issued_atYesYYYY-MM-DD or null
confidenceYes
line_itemsYes
amount_paidNo
balance_dueNo
document_idNo
locale_hintsNo
raw_text_excerptNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.6/5.0
Behavior5/5

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

Annotations already cover the safety profile (readOnly, idempotent, non-destructive, closed-world), and the description adds information structured fields cannot carry: per-call price ($0.15 / 15 credits), that failed calls may still be billed, and payment mechanisms (prepaid credits or x402). It also discloses output semantics — nulls mean unknown, low-confidence totals need warning checks, and vat_total_mismatch is a possible warning — which directly affects how an agent should trust the result.

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 what-and-when is front-loaded in the first two sentences and the caveats follow in a logical order. Slightly overlong: the 'Built for NG/KE/GH/ZA AP automation ... not a thin keyword grep' clause leans promotional, though it does help differentiation.

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, yet the description still enumerates the contract fields so an agent knows what it will get, and it covers cost, input modes, and reliability caveats. For a paid, one-shot extraction call this is complete enough to invoke correctly.

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 baseline is 3; the description reinforces the text-vs-base64 input duality but adds no format or size detail beyond the schema. The 'tier' enum (S/M/L/auto) remains unexplained in both schema and description, which is the one semantic gap the prose could have closed.

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?

Opens with a specific verb (Parse) and resource (tax/commercial invoice) and names the output contract (AfricaInvoiceReceipt) plus the exact field set produced. It also explicitly separates itself from the till-slip sibling, so an agent can pick the right tool without opening a schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

States the selecting condition ('Use when the document is an invoice rather than a till slip') and names both accepted input modes (OCR text or image/PDF base64). The domain scoping (NG/KE/GH/ZA AP automation, multi-line SKU invoices) further narrows when this is the right call.

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