Extract invoice fields
extract_invoice_fieldsRead an uploaded invoice PDF and return the fields found on it — supplier, invoice number, dates, totals, VAT, currency, line items. Run this between create_invoice_upload_url and book_invoice: MCP cannot carry a binary, so this is how an agent learns what the PDF actually says instead of having to be told. Handles text PDFs, scanned/image PDFs (vision OCR) and embedded XInvoice XML. Writes the result to the document's extracted_fields and returns it. It EXTRACTS but does not book — the amounts and the tax treatment are still your decision, and book_invoice is what records them.
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": {
"document_id": "<document_id>"
},
"name": "extract_invoice_fields"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| force | No | Re-read the PDF even if extracted_fields is already populated. Default false, which returns what is already stored instead of paying for another extraction. | |
| document_id | Yes | The document to read, from create_invoice_upload_url. The PDF must already be uploaded. |