Skip to main content
Glama

Receipts & invoices to spreadsheet

extract_documents

Read-onlyIdempotent

Read receipts and invoices (JPG, PNG, WebP, HEIC, PDF, or a zip of them; one document per file or PDF; up to 25 documents per call, 10 MB each, PDFs up to 10 pages) into checked numbers. Give each file as file_id (from create_upload), url (public https) or data_base64 (up to 2 MB inline). MCP requests are capped near 4 MB by the SDK, so keep all inline base64 in one call under about 2 MB and use create_upload for more. Returns one entry per document with vendor, date, currency, line items, subtotal, tax, total and payment method, each field marked ok, check or missing, the checks that ran, a status of ready or needs_review with review_reasons, and duplicate_of for a repeated receipt. Money is a decimal string, never a float. Each document also carries printed: its dates and currency as printed, the paths of fields whose text could not be read (printed.unreadable), the paths of fields a second read changed after a failed check (printed.second_look), and the paths of amounts printed with a dotted thousands separator on a rupiah-style receipt ("31.000") that were read as the whole number (printed.thousands; the value is already converted and the field is marked check), and the paths of amounts the model returned as JSON numbers, whose printed digits are lost (printed.number_typed; the field is marked check). Also returns 24-hour download links for the exports you ask for: csv (default), line_items_csv, quickbooks_csv (one currency; set quickbooks_currency and quickbooks_date_format, MM/DD/YYYY or DD/MM/YYYY) and file_pack (a zip of the originals renamed by date, vendor and total, plus documents.csv). Each link lists the documents left out of that file: quickbooks_csv leaves out every document with status needs_review (and ones missing a date or total), with the reason; csv, line_items_csv and file_pack keep every document. Hints: country (ISO 3166-1 alpha-2) and currency (ISO 4217) help with unclear receipts, date_order (DMY or MDY) settles dates like 03/04/2026. Show documents with status needs_review and their review_reasons to the user before using their numbers. Free for now within a daily quota counted in documents (see start.md); price when payments are enabled: $0.01 per document. Use a client timeout of at least 240 s.

Input Schema

NameRequiredDescriptionDefault
filesYesDocuments to read. Each item needs exactly one of file_id, url or data_base64
countryNoCountry of the documents, ISO 3166-1 alpha-2 (for example DE)
exportsNoFiles to produce, each as a 24-hour download link. Default: csv; [] writes no file
currencyNoCurrency to expect when a document does not print one, ISO 4217 (for example EUR)
date_orderNoHow all-numeric dates such as 03/04/2026 are written: day first or month first
quickbooks_currencyNoquickbooks_csv: the one currency the file holds (default: the most common one)
quickbooks_date_formatNoquickbooks_csv: how dates are written (default MM/DD/YYYY)

Output Schema

NameRequiredDescriptionDefault
readyYes
exportsYes
skippedYes
documentsYes
needs_reviewYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.7/5.0
Behavior5/5

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

Annotations already declare readOnly, idempotent, non-destructive, open-world, but the description goes well beyond: quotas and per-document pricing, the 25-document/10 MB/10-page caps, money returned as decimal strings rather than floats, duplicate_of and status/review_reasons semantics, and which documents each export omits. These are real behavioral traits an agent could not infer from the annotations or schema.

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

Conciseness3/5

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

Front-loaded and dense, but delivered as a single unbroken paragraph of roughly 300 words mixing input rules, return-value diagnostics, export filtering, hints and pricing. Since an output schema already exists, the long enumeration of printed.unreadable/second_look/thousands/number_typed paths is the least essential part and could be much shorter.

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?

For a 7-parameter, high-consequence extraction tool, the description covers what an agent needs: input size limits and the create_upload fallback, timeout expectations, review-before-use guidance, cost/quota, and per-export inclusion rules. Return shape is further backed by the output schema, so nothing critical is missing.

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 baseline is 3, and the description adds genuine meaning: country and currency are framed as hints that help with unclear receipts, date_order is explained against the concrete ambiguity of 03/04/2026, and quickbooks_currency is tied to the one-currency constraint of that export. Only filename is left wholly to the schema.

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 and resource: read receipts and invoices into checked numbers, then names the accepted formats and per-call limits. An agent can immediately tell this is an OCR/extraction tool and distinguish it from the only sibling, create_upload.

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?

Explicitly routes input modes (file_id from create_upload, url, or data_base64) and states the threshold at which the agent must switch to create_upload because of the ~4 MB MCP request cap. It also gives operational guidance (timeout of at least 240 s, review needs_review documents with the user before using the numbers) and names the sibling tool to use for larger payloads.

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