Skip to main content
Glama
cmendezs

mcp-fattura-elettronica-it

Validate Ubl Invoice

validate_ubl_invoice

Validate UBL 2.1 invoice XML for structural correctness, checking required core fields like invoice number, dates, seller, buyer, and line items. Returns validation results with warnings or errors.

Instructions

Validate a UBL 2.1 invoice XML string for structural correctness.

Performs structural validation by parsing the XML into an EN16931Invoice and checking that required core fields (invoice_number, invoice_date, seller, buyer, at least one line item) are present and non-empty.

Note: this tool does NOT validate against the normative UBL 2.1 XSD schema (the UBL XSD files are not bundled with this package). For full XSD validation use a dedicated UBL validator or the Peppol Validator tool.

On success returns {'valid': true, 'warnings': list[str]}. On failure returns {'valid': false, 'errors': list[str]}. On parse error returns {'valid': false, 'errors': ['XML parse error: ...']}.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
xml_stringYesUBL 2.1 Invoice or CreditNote XML string to validate. Must contain a root element in the UBL Invoice-2 or CreditNote-2 namespace.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.2.5

TDQS

A4.3/5.0
Behavior4/5

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

No annotations are provided, so the description carries the full burden. It discloses the exact return values for three outcomes (success, failure, parse error), which is critical for agent understanding. It also explains the limitation of not validating against the XSD and the reason (XSD files not bundled). This is solid behavior disclosure, but could be enriched with more detail on the parsing behavior or the nature of warnings.

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 well-structured into clear segments: what it does, what it doesn't do, and return values. It is concise but covers all necessary points. The return value section is separated clearly. It's slightly longer than necessary but every part serves a purpose.

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?

Given the tool is a single-parameter validation function, the description covers the input requirements, the limitations, and the output structure. An output schema exists, so return values are not expected in detail in the description, but they are provided anyway. This is nearly complete; it could mention that it only validates certain invoice types or specify the namespace coverage more, but these are minor.

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?

The schema description coverage is 100% and the parameter is simple (xml_string with a clear description). The tool description does not add much beyond the schema, but that is acceptable given the schema is already descriptive. The tool description does clarify the input should be an XML string, but this is also in the schema. Baseline 3 is appropriate.

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 UBL 2.1 invoice XML string for structural correctness, specifying the key fields checked. It distinctly differentiates from siblings like validate_fattura_xsd (XSD validation) and validate_cii_invoice (different format).

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 explicitly notes what it does NOT do (XSD validation) and points the user to alternatives: 'For full XSD validation use a dedicated UBL validator or the Peppol Validator tool.' This provides clear guidance on when to use this tool versus others.

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