Validate VeriFactu invoice chain
validate_invoice_chainAudit a VERI*FACTU invoice chain by recomputing AEAT fingerprints and verifying record links to detect breaks, altered records, duplicates, and invalid data.
Instructions
Audit a VERI*FACTU chain of records (in generation order) given as JSON objects.
Each record has the fields of verifactu_hash plus Huella (stored fingerprint) and optionally
HuellaAnterior or RegistroAnterior {IDEmisorFactura, NumSerieFactura, FechaExpedicionFactura, Huella} and
PrimerRegistro ("S"). For every record the fingerprint is recomputed and compared, and the link to the
previous record checked. Reports chain breaks, altered records, PrimerRegistro misuse, duplicate invoices,
cancellations of unknown invoices, timestamps going backwards, invalid NIF/dates/amounts/TipoFactura.
continues_from: last fingerprint of the previous batch, to audit a chain in pieces. Up to 20,000 records.
last_huella is what the next record must link to.
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": {
"records": "<records>"
},
"name": "validate_invoice_chain"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| records | Yes | ||
| continues_from | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||