Skip to main content
Glama
cmendezs

mcp-fattura-elettronica-it

parse_fattura_xml

Parse Italian electronic invoice XML (FatturaPA) into a structured Python dictionary for inspection or processing, including seller, buyer, line items, and payment details.

Instructions

Parse a FatturaPA XML string into a structured Python dict.

Use this to inspect or process invoices received from counterparties, or to verify the output of generate_fattura_xml(). Accepts both FPR12 (B2B) and FPA12 (PA) formats. The result can be passed directly to export_to_json().

Extracts: versione, transmission data, seller/buyer identity and address, document type/date/number/causale, all DettaglioLinee, DatiRiepilogo, and DatiPagamento if present. Fields not found in the XML are returned as null.

On success returns {'versione': str, 'header': {...}, 'body': {...}}. On XML parse error returns {'error': 'XML parse error: '}. On missing lxml returns {'error': 'lxml is not installed...'}.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
xml_stringYesFatturaPA XML string to parse. Accepts both single-invoice (FPR12) and PA-addressed (FPA12) formats.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior5/5

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

Fully discloses behavior without annotations: returns structured dict with versione/header/body, null for missing fields, and two distinct error formats for parse errors and missing lxml. No contradictions.

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?

Well-structured with front-loaded purpose. 8 sentences, each informative. Slight redundancy in listing fields twice (abstract and detail), but no wasted text.

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?

Covers all aspects: purpose, inputs, outputs, error states, and interoperability. With high schema coverage and output schema present, no gaps remain.

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 coverage is 100%, so the description adds limited value beyond restating the schema. The context about accepting FPR12/FPA12 is already in the schema description. The additional 'export_to_json' reference is not parameter-specific.

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?

Clearly states the tool parses FatturaPA XML into a structured dict, lists specific use cases (inspect/process invoices, verify generate_fattura_xml), and enumerates extracted fields. Distinguishes from siblings by its specific parsing role.

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?

Provides explicit use cases (inspect/process invoices, verify generate_fattura_xml) and mentions downstream integration with export_to_json(). Lacks explicit when-not-to-use or alternatives, but sibling tools are distinct and no direct competition exists.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/cmendezs/mcp-fattura-elettronica-it'

If you have feedback or need assistance with the MCP directory API, please join our Discord server