Skip to main content
Glama

Italian SDI FatturaPA v1.2.2 Tax Validator & Sanitizer

fatturapa_sdi_sanitizer
Read-onlyIdempotent

[Italian SDI FatturaPA v1.2.2 validator & tax sanitizer. Deterministic calculation, read-only, side-effect free]. Validates and sanitizes Italian FatturaPA XML payloads (FPR12 B2B / FPA12 PA), verifying 7-character Codice Destinatario / PEC, Natura IVA codes (N1-N7), Split Payment deductions (Art. 17-ter), virtual stamp duty (€2.00 bollo virtuale), and withholding taxes. Usage: Use this tool before submitting invoices to Sistema di Interscambio (SDI) to prevent statutory rejection codes (Scarto SDI). Returns: JSON object with { numeroFattura: string, sdiTransmissionReady: boolean, formatoTrasmissione: string, codiceDestinatarioValido: boolean, totaliFinanziari: object, bloccoErroriSdi: array, avvertenzeFiscali: array }.

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": {
      "tipoDocumento": "<tipoDocumento>",
      "numeroFattura": "<numeroFattura>",
      "dataFatturaIso": "<dataFatturaIso>",
      "cedentePartitaIva": "<cedentePartitaIva>",
      "regimeFiscale": "<regimeFiscale>",
      "cessionarioPartitaIvaOrCf": "<cessionarioPartitaIvaOrCf>",
      "codiceDestinatarioSdi": "<codiceDestinatarioSdi>",
      "isPubblicaAmministrazione": "<isPubblicaAmministrazione>",
      "righeFattura": "<righeFattura>"
    },
    "name": "fatturapa_sdi_sanitizer"
  }
}

Input Schema

NameRequiredDescriptionDefault
righeFatturaYesArray of invoice item lines
numeroFatturaYesProgressive invoice number
regimeFiscaleYesFiscal regime (RF01 ordinary, RF19 flat-rate forfettario)
tipoDocumentoYesFatturaPA document type (e.g. TD01 invoice, TD04 credit note, TD16-19 reverse charge)
dataFatturaIsoYesInvoice date (YYYY-MM-DD)
esigibilitaIvaNoVAT collectibility (I immediate, D deferred, S split payment)
pecDestinatarioNoRecipient PEC email address (mandatory if Codice Destinatario is 0000000)
cedentePartitaIvaYesSeller Italian VAT number (11 digits)
codiceDestinatarioSdiYes7-char SDI recipient code (or 6-char for Public Administration, or 0000000 with PEC)
cessionarioPartitaIvaOrCfYesBuyer tax code or VAT number
isPubblicaAmministrazioneYesTrue if recipient is an Italian Public Administration (IPA)
applicaRitenutaAccontoPercentNoWithholding tax rate percentage (e.g. 20% for professional services)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.1/5.0
Behavior4/5

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

Annotations already declare readOnlyHint, idempotentHint and destructiveHint=false, so the 'read-only, side-effect free, deterministic' phrasing is largely redundant. The description does add value by specifying the validation scope and, importantly, by spelling out the returned JSON fields (sdiTransmissionReady, codiceDestinatarioValido, bloccoErroriSdi, avvertenzeFiscali), which no output schema supplies.

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

Conciseness4/5

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

The definition is front-loaded with a purpose statement, then explicit Usage and Returns sections, which makes it scannable. Minor waste exists in the bracketed restatement of read-only/deterministic properties already covered by annotations.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 12-parameter, 9-required validator with no output schema, the description supplies both the scope of validation and the shape of the result object, which is the most important missing structural information. Remaining gaps (e.g., how errors versus warnings are populated) are minor given the exhaustive schema.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so every one of the 12 parameters is already documented in the schema, including the PEC fallback for codice 0000000 and the Natura enum. The description adds some regulatory context (7-character code format, Art. 17-ter split payment, bollo amount) but does not explain parameters the schema leaves ambiguous, so the baseline 3 applies.

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 names a specific verb and resource (validates and sanitizes Italian FatturaPA XML payloads for FPR12 B2B / FPA12 PA) and enumerates the exact checks performed (Codice Destinatario/PEC, Natura IVA N1-N7, split payment Art. 17-ter, €2.00 bollo virtuale, withholding). This is clearly distinguishable from the sibling validators, which target different regulatory domains.

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?

The Usage line gives an explicit trigger: run it before submitting invoices to SDI to avoid Scarto SDI rejection codes. That is a clear when-to-use statement, but there are no explicit when-not conditions or named alternative tools for adjacent cases.

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