Skip to main content
Glama
cmendezs

mcp-fattura-elettronica-it

Validate Fattura Xsd

validate_fattura_xsd

Validate FatturaPA XML against official Agenzia delle Entrate XSD v1.2.3, automatically selecting FPR12 or FPA12 schema by version attribute. Returns validity and detailed errors to ensure compliance before transmission.

Instructions

Validate a FatturaPA XML string against the official Agenzia delle Entrate XSD v1.2.3.

Use this as step 11 — always call immediately after generate_fattura_xml() before storing or transmitting the document. Also use to verify third-party invoices received from suppliers.

Automatically selects the correct XSD based on the document's versione attribute: FPR12 (B2B/B2C) uses FatturaPA_FPR12_v1.2.3.xsd; FPA12 (B2G) uses FatturaPA_FPA12_v1.2.3.xsd. FATTURA_XSD_PATH env var overrides both.

Requires lxml. Validates namespace, element structure, data types, and cardinality.

On success returns {'valid': true, 'formato_trasmissione': 'FPR12'|'FPA12', 'errors': []}. On failure returns {'valid': false, 'errors': ['', ...]}. On setup error (missing lxml or XSD file) returns {'error': ''}.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
xml_stringYesComplete FatturaPA XML string to validate. Must include the FatturaElettronica root element with the correct namespace (http://ivaservizi.agenziaentrate.gov.it/docs/xsd/fatture/v1.2).

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.2.0

TDQS

A4.9/5.0
Behavior5/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure, and it does so thoroughly. It explains automatic XSD selection based on the 'versione' attribute, the FATTURA_XSD_PATH override, the lxml dependency, validation scope (namespace, structure, data types, cardinality), and all three return shapes.

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 information-dense without being bloated: it front-loads the purpose, immediately gives workflow placement, then covers XSD selection, dependencies, validation scope, and return values. Every sentence contributes actionable information an agent needs.

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?

The description covers when to invoke, what the input must include, how XSD selection works, failure modes, and exact return structures for success, validation failure, and setup errors. Nothing essential is missing for an agent to select and invoke this tool correctly.

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?

The input schema already documents xml_string fully, including the root element and namespace, so schema coverage is 100%. The description adds useful meaning beyond the schema by explaining how the document's 'versione' attribute drives XSD selection, which gives the agent a clearer expectation of what the XML string must contain.

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 clearly states the tool validates a FatturaPA XML string against the official Agenzia delle Entrate XSD v1.2.3, using a specific verb ('Validate') and a specific resource. It also references the official XSD and the XML format, distinguishing it from siblings like validate_fattura_semplificata_xsd or validate_ubl_invoice.

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

Usage Guidelines5/5

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

The description gives explicit workflow guidance: 'always call immediately after generate_fattura_xml() before storing or transmitting the document' and also covers verifying third-party supplier invoices. This clearly indicates when to use the tool relative to the broader invoice-generation pipeline.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.