FatturaPA: parse + supplier anti-fraud check
parse_verify_fatturapaExtracts structured data from a FatturaPA/SDI XML e-invoice AND, in the same call, runs an anti-fraud check on the chosen party (default: the CEDENTE, i.e. the supplier who receives the bank transfer). The checked data are NOT inferred by an LLM: VAT number, Codice Fiscale, company name and payment IBAN are extracted deterministically from the XML, then passed to the checks: IBAN (MOD-97 checksum + bank from the ABI code), VAT number and CF (checksum) and — when the EU service is reachable — the real registered name via live VIES, compared with the one stated on the invoice. Returns the full parse plus supplier_verification with a verdict (ok / non_verificabile / attenzione / alto_rischio = ok / not verifiable / caution / high risk) and specific red flags; if the invoice carries several distinct IBANs it flags it and lowers the verdict. It is the defence against the IBAN-change fraud on incoming invoices. Like verify_payee it performs external I/O (a single VIES query per call, not one per line): if VIES is down or the shared budget is exhausted the verdict degrades HONESTLY to "attenzione", never to a false "ok". It does NOT replace out-of-band verification (a phone call to the supplier on an already known number).
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": {
"xml_content": "<xml_content>"
},
"name": "parse_verify_fatturapa"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| party | No | Party to check: 'cedente' = supplier/payee (default, the anti-fraud case); 'cessionario' = customer. The IBAN is collected only for the cedente, because the cedente is the one who gets paid. | cedente |
| xml_content | Yes | The XML content of the electronic invoice (FatturaPA/SDI). A .p7m must be unwrapped first: plain-text XML only. | |
| expected_country | No | Expected supplier country, ISO2. If omitted, the country stated by the invoice itself (the cedente's seat) applies, and only failing that 'IT'. A foreign IBAN on a supplier expected to be Italian is fraud warning sign #1. |