Skip to main content
Glama

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.2/5.0
Behavior4/5

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

Annotations already declare readOnlyHint and idempotentHint, and the description reinforces this with deterministic, side-effect-free behavior. It adds valuable domain behavior by listing the checks performed and the JSON return fields, though it does not discuss authentication, rate limits, or error handling.

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 description is front-loaded with the tool's purpose and structured into validation scope, usage, and return shape. It is appropriately sized, with only minor redundancy between the bracketed read-only statement and the annotations.

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 12-parameter validator with no output schema, the description is complete enough to call correctly. It explains the validation scope, intended usage, and return fields an agent needs to interpret results.

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 the schema already explains all parameters and their enums. The description reinforces key validation areas such as Codice Destinatario, PEC, Natura IVA, split payment, bollo virtuale, and withholding taxes, but adds little syntax beyond 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 states a specific verb and resource: validates and sanitizes Italian FatturaPA XML payloads for SDI. It names the formats (FPR12 B2B / FPA12 PA) and the validation domains, making the tool's purpose unambiguous.

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 gives a clear usage context: use before submitting invoices to SDI to prevent statutory rejection codes. It does not state when not to use the tool or name explicit alternatives, but the intended timing is clear.

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