Skip to main content
Glama
cmendezs

mcp-fattura-elettronica-it

generate_fattura_xml

Assemble a complete FatturaPA v1.2.3 XML document from all prepared blocks: transmission header, seller, buyer, document data, line items, and VAT summary. Returns the XML string and filename for final validation.

Instructions

Assemble a complete FatturaPA v1.2.3 XML document from all prepared blocks.

Use this as step 10 in the invoice generation workflow — the final assembly step. All required blocks must come from their respective builder/validator tools; pass the full dict returned by each tool (the function unwraps the top-level key).

Required: dati_trasmissione, cedente_prestatore, cessionario_committente, dati_generali, dettaglio_linee (list), dati_riepilogo (list from compute_totali()). Optional: dati_pagamento, allegati (list), dati_ritenuta.

Does NOT validate against the XSD schema — call validate_fattura_xsd() (step 11) on the returned 'xml' string immediately after to confirm conformance.

On success returns {'xml': str, 'filename': str, 'formato_trasmissione': str, 'length_bytes': int}. On unexpected error returns {'error': ''}.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dati_trasmissioneYesDatiTrasmissione block from build_transmission_header(). Must contain IdTrasmittente, ProgressivoInvio, FormatoTrasmissione, and CodiceDestinatario.
cedente_prestatoreYesCedentePrestatore block from validate_cedente_prestatore(). Contains seller's tax ID, name, address, and fiscal regime.
cessionario_committenteYesCessionarioCommittente block from validate_cessionario(). Contains buyer's tax ID, name, and address.
dati_generaliYesDatiGenerali block from build_dati_generali(). Contains document type, date, number, and currency.
dettaglio_lineeYesList of DettaglioLinee dicts from add_linea_dettaglio(). Each entry must have NumeroLinea, Descrizione, PrezzoUnitario, PrezzoTotale, and AliquotaIVA.
dati_riepilogoYesList of DatiRiepilogo dicts from compute_totali(). Contains VAT summary grouped by AliquotaIVA.
dati_pagamentoNoDatiPagamento block from build_dati_pagamento(). Optional.
allegatiNoList of Allegati dicts from add_allegato(). Optional.
dati_ritenutaNoDatiRitenuta block from check_ritenuta_acconto(). Required for professional invoices with withholding tax (ritenuta d'acconto).

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior4/5

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

With no annotations, the description carries full burden. It discloses that the tool assembles XML, does not validate against XSD, expects full dicts from builder/validator tools, and returns success/error objects. It could add more detail about error handling or unwrapping, but overall sufficient.

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 front-loaded with purpose and usage, structured logically with lists and caveats. It is somewhat verbose but efficient, earning its space by providing necessary workflow context.

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?

For a complex tool with 9 parameters (6 required), nested objects, and an output schema, the description is comprehensive. It covers all inputs, return format, workflow integration, and critical warning about non-validation. No gaps for an AI agent to select and use 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?

Schema descriptions cover all parameters (100% coverage). The description adds value by explaining that parameters must be full dicts from specific builder/validator tools and that the function unwraps the top-level key. This workflow context enhances understanding beyond schema descriptions.

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: 'Assemble a complete FatturaPA v1.2.3 XML document from all prepared blocks.' It identifies itself as step 10 in the invoice generation workflow, which distinguishes it from sibling blocks like builder/validator tools.

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?

Explicitly says 'Use this as step 10 in the invoice generation workflow — the final assembly step.' It lists required blocks and their sources, provides alternative for validation ('call validate_fattura_xsd() (step 11)'), and clarifies what not to expect.

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