Skip to main content
Glama
cmendezs

mcp-fattura-elettronica-it

parse_fattura_xml

Parse a FatturaPA XML string into a structured Python dictionary to inspect or process electronic invoices from counterparties or verify generated invoices.

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?

No annotations exist, so the description carries full burden. It discloses success output structure, error handling for XML parse errors and missing lxml, and notes that missing fields return null. This is comprehensive behavioral transparency.

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 moderately lengthy but well-structured with clear sections. It front-loads the purpose and uses bullet-like enumeration for extracted fields. All sentences add value, though it could be slightly more concise.

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?

Given the presence of an output schema and single parameter, the description covers purpose, usage, behavior, parameter details, output format, and error handling. It is complete and leaves no obvious gaps for the agent.

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% (one parameter with schema description). The description adds value by explaining the accepted formats (FPR12 and FPA12) and details the output structure, which the schema does not cover. This goes beyond the schema, justifying a 4.

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's purpose: parsing a FatturaPA XML string into a structured Python dict. It specifies the verb ('parse'), resource ('FatturaPA XML'), and output format ('structured Python dict'). It distinguishes from siblings like generate_fattura_xml and export_to_json by mentioning verification and direct passing to export_to_json().

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?

The description explicitly says 'Use this to inspect or process invoices received from counterparties, or to verify the output of generate_fattura_xml().' This provides clear context. It also notes that it accepts both FPR12 and FPA12 formats. While it doesn't mention when not to use, it offers sufficient guidance given the sibling list lacks a similar parser.

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