Skip to main content
Glama

Imperio — Italian Tax & Compliance Tools

FatturaPA: parse + verifica anti-frode del fornitore

parse_verify_fatturapa
Read-onlyIdempotent

Estrae i dati strutturati da un XML FatturaPA/SDI E, nella stessa chiamata, verifica anti-frode la parte indicata (default: il CEDENTE, cioè il fornitore che incassa il bonifico). I dati verificati NON sono inferiti da un LLM: P.IVA, Codice Fiscale, ragione sociale e IBAN di pagamento sono estratti deterministicamente dall'XML, poi passati ai controlli: IBAN (checksum MOD-97 + banca dal codice ABI), P.IVA e CF (checksum) e — quando il servizio UE è raggiungibile — la ragione sociale reale via VIES live, confrontata con quella dichiarata in fattura. Restituisce il parse completo più supplier_verification con verdetto (ok / non_verificabile / attenzione / alto_rischio) e red flag puntuali; se la fattura riporta più IBAN distinti lo segnala e abbassa il verdetto. È la difesa contro la truffa del cambio-IBAN sulle fatture passive. Come verify_payee fa I/O esterno (una sola interrogazione VIES per chiamata, non una per riga): se VIES è giù o il budget condiviso è esaurito il verdetto degrada ONESTAMENTE ad "attenzione", mai a un falso "ok". Gratis (€0), nessun login. NON sostituisce la verifica out-of-band (telefonata al fornitore su un numero già noto).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
partyNoParte da verificare: 'cedente' = fornitore/chi riceve il pagamento (default, il caso anti-frode); 'cessionario' = cliente. L'IBAN viene raccolto solo per il cedente, perché è lui che incassa.cedente
xml_contentYesIl contenuto XML della fattura elettronica (FatturaPA/SDI). Il .p7m va scompattato prima: qui si accetta XML testuale.
expected_countryNoPaese atteso del fornitore in ISO2. Se omesso vale il paese dichiarato dalla fattura stessa (sede del cedente), e solo in sua mancanza 'IT'. Un IBAN estero su un fornitore atteso italiano è il campanello #1 della frode.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • removedInput schema / properties / expected_country / default
      Removed value: -"IT"
    • changedInput schema / properties / expected_country / description
      Previous value: -"Paese atteso del fornitore in ISO2. Un IBAN estero su un fornitore atteso italiano è il campanello #1 della frode."New value: +"Paese atteso del fornitore in ISO2. Se omesso vale il paese dichiarato dalla fattura stessa (sede del cedente), e solo in sua mancanza 'IT'. Un IBAN estero su un fornitore atteso italiano è il campanello #1 della frode."
  2. Added

TDQS

A4.7/5.0
Behavior5/5

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

The description goes far beyond the annotations by disclosing deterministic extraction ('NON sono inferiti da un LLM'), exact validation logic (MOD-97, ABI, P.IVA/CF checksums), live VIES behavior with honest degradation ('degradare ONESTAMENTE ad attenzione, mai a un falso ok'), and external I/O limits (one VIES query per call). It also adds cost and authentication context ('Gratis (€0), nessun login'). This is consistent with readOnlyHint since the external I/O is a read-only lookup.

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

Conciseness5/5

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

The description is long but dense and every clause earns its place: extraction, verification checks, verdict scale, multi-IBAN handling, VIES budget degradation, cost/auth, and the out-of-band caveat. The verb and scope are front-loaded, with the most important operational constraints following logically.

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 complex tool with no output schema, the description covers return content (parse + supplier_verification verdicts/red flags), failure modes (VIES unreachable, shared budget exhausted), the external I/O constraint, and the safety caveat about out-of-band verification. The input contract is already documented in the schema, so nothing essential is missing for correct invocation.

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 the baseline is 3. The description adds fraud-relevant meaning beyond the schema, such as why party defaults to cedente ('è lui che incassa'), why IBAN is collected only for the cedente, and the red-flag rule that a foreign IBAN on an expected Italian supplier is 'il campanello #1 della frode'. These enrich, rather than merely repeat, 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?

The description opens with a specific verb-resource pair: 'Estrae i dati strutturati da un XML FatturaPA/SDI' and immediately adds the anti-fraud verification performed in the same call. It names the exact checks and distinguishes itself from siblings like parse_fatturapa and verify_payee by combining parsing with verification.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It clearly states the intended use case ('È la difesa contro la truffa del cambio-IBAN sulle fatture passive') and a key limitation ('NON sostituisce la verifica out-of-band'). It also explains behavior when VIES is down or the budget is exhausted. However, it does not explicitly say when to use this tool instead of parse_fatturapa or verify_payee for standalone needs.

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