invoicelens_extract_invoice
Extract structured invoice fields from PDFs—vendor, dates, line items, totals—and validate arithmetic to flag misreads or incorrect invoices.
Instructions
Extract one invoice into structured fields (vendor, invoice number, dates, currency, line items, subtotal, tax, total) and check them: line items vs subtotal, subtotal + tax vs total, tax rate, dates.
validation.valid = false means the numbers don't add up — either a misread (retry with
feedback) or an invoice that is genuinely wrong. Values are reported as printed, never
silently corrected.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | No | Path to a PDF on the server's filesystem (local/stdio use only). | |
| doc_id | No | An ingested document's doc_id (from ingest or search). | |
| feedback | No | Validation errors from a previous attempt, to guide a corrected re-read. | |
| collection | No | Index to use, e.g. 'default' or a per-client name. Lowercase letters, digits, '-', '_'. | |
| pdf_base64 | No | The PDF file content, base64-encoded. Use this when the server is remote. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| doc_id | No | ||
| invoice | Yes | ||
| filename | No | ||
| extractor | Yes | ||
| validation | Yes |