Skip to main content
Glama
cmendezs

mcp-fattura-elettronica-it

Parse Ubl Invoice

parse_ubl_invoice

Parse UBL 2.1 invoice XML into EN 16931 structured fields to inspect cross-border invoices or verify generated UBL output. Returns JSON-serializable dict or error.

Instructions

Parse a UBL 2.1 invoice XML string into an EN 16931 structured dict.

Extracts the EN 16931 core field set. Italian national fields (progressivo_invio, regime_fiscale, etc.) are returned with their ItalianInvoice defaults since UBL 2.1 does not carry them.

Use this to inspect cross-border invoices received in UBL format, or to round-trip the output of generate_ubl_invoice() for verification.

On success returns the ItalianInvoice fields as a JSON-serialisable dict. On failure returns {'error': str}.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
xml_stringYesUBL 2.1 Invoice or CreditNote XML string to parse. Returns an EN 16931 field dict. National extensions are silently ignored.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.2.5

TDQS

A4.6/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 that Italian national fields are returned with defaults because UBL 2.1 does not carry them, and that national extensions are silently ignored. It also states the failure return shape ({'error': str}). This is meaningful behavioral context beyond the schema. It doesn't mention side effects, but parsing is inherently read-only, so the gap is minor.

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 compact and well-structured: a one-sentence core definition, a short paragraph on field behavior, a clear usage sentence, and a two-line return contract. Every sentence earns its place, and the most important information (what it parses and what it returns) is front-loaded.

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?

The tool has a single parameter, a rich output schema, and no annotations. The description covers the input format, the output format, the handling of Italian fields, the failure mode, and the use case. It doesn't explicitly describe the output schema structure, but the output schema exists and the description says it returns 'the ItalianInvoice fields as a JSON-serialisable dict', which is sufficient for an agent to invoke it 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?

Schema coverage is 100%, so the baseline is 3. The description adds value by explaining the input is a UBL 2.1 Invoice or CreditNote XML string, that national extensions are silently ignored, and that the output is an EN 16931 field dict. This goes beyond the schema's terse 'UBL 2.1 Invoice or CreditNote XML string to parse' and clarifies the behavior for the single parameter.

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 ('Parse'), a precise resource ('UBL 2.1 invoice XML string'), and a clear output ('EN 16931 structured dict'). It also distinguishes itself from siblings like parse_fattura_xml and parse_cii_invoice by naming the UBL format and the EN 16931 target. The mention of round-tripping with generate_ubl_invoice() further clarifies its role.

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 says when to use this tool: 'Use this to inspect cross-border invoices received in UBL format, or to round-trip the output of generate_ubl_invoice() for verification.' It also implicitly contrasts with parse_fattura_xml (Italian format) and parse_cii_invoice (CII format) by specifying UBL. This is clear, actionable guidance.

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