Skip to main content
Glama
cmendezs

mcp-fattura-elettronica-it

add_linea_dettaglio

Add a single line item (DettaglioLinee) to the FatturaElettronicaBody for Italian e-invoicing. Call once per product or service, using sequential numbering and providing the total price explicitly.

Instructions

Build a single DettaglioLinee (line item) entry for the FatturaElettronicaBody.

Use this as step 7 in the invoice generation workflow — call once per line item after build_dati_generali(). Collect all returned dicts into a list and pass it to compute_totali() (step 8) and then generate_fattura_xml() (step 10).

numero_linea must be sequential starting at 1; do not reuse numbers in the same invoice. prezzo_totale must be provided explicitly (not computed); use negative values for credit notes. When aliquota_iva is 0.0, natura is required — call get_natura_codes() to select the code. Set ritenuta='SI' on lines subject to withholding tax and include the DatiRitenuta block from check_ritenuta_acconto() when generating XML.

On success returns {'DettaglioLinee': {...}}. On failure returns {'error': ''}.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
numero_lineaYesSequential line number starting at 1. Each DettaglioLinee entry must have a unique NumeroLinea.
descrizioneYesDescription of the good or service (max 1000 chars).
quantitaNoQuantity (Quantita). Optional for services billed as a lump sum. When provided, unit_price × quantita should equal prezzo_totale.
unita_misuraNoUnit of measure (e.g. 'PZ', 'KG', 'ORE', 'M2'). Optional.
prezzo_unitarioNoUnit price before VAT (PrezzoUnitario). Negative for credit notes.
prezzo_totaleNoTotal line amount before VAT (PrezzoTotale = quantita × prezzo_unitario). Must be provided explicitly; the tool does not auto-compute it.
aliquota_ivaNoVAT rate as a percentage (e.g. 22.0 for 22%, 10.0 for 10%, 0.0 for exempt). Use 0.0 together with a Natura code for exempt/out-of-scope supplies.
naturaNoNatura exemption code (N1–N7, N2.1, N2.2, N3.1–N3.6, N6.1–N6.9, N7). Required when aliquota_iva is 0.0. Use get_natura_codes() for the full list.
ritenutaNoWithholding tax flag: 'SI' to indicate that this line is subject to ritenuta d'acconto. Use check_ritenuta_acconto() to compute the amount.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior5/5

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

With no annotations provided, the description fully discloses behaviors: it does not auto-compute prezzo_totale, requires negative values for credit notes, mandates natura when aliquota_iva is 0, and explains the ritenuta flag requirement. It also specifies return values (success dict or error). This is comprehensive for a mutation tool.

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 a single paragraph that efficiently conveys workflow position, parameter constraints, and return types. It is front-loaded with purpose and step context. While slightly dense, every sentence adds necessary detail, earning a high score.

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 tool's complexity (9 parameters, workflow integration, conditional rules) and the existence of an output schema, the description covers all essential aspects: what the tool does, when to call it, prerequisites, field constraints, error handling, and integration with sibling tools. No gaps remain.

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?

Though the schema has 100% description coverage, the tool description adds meaningful context beyond field names: e.g., 'numero_linea must be sequential starting at 1', 'prezzo_totale must be provided explicitly', 'negative for credit notes', and conditions linking natura and aliquota_iva. This adds significant value, justifying a score above the baseline of 3.

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 that the tool builds a single DettaglioLinee entry for the FatturaElettronicaBody, using specific verbs and resource. It distinguishes itself from sibling tools by referencing the overall workflow (step 7) and naming related tools like build_dati_generali and compute_totali.

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 states when to use this tool (step 7 in the invoice generation workflow), what to do before (build_dati_generali) and after (collect results and pass to compute_totali, generate_fattura_xml). It also provides guidance on when to call auxiliary tools like get_natura_codes and check_ritenuta_acconto, leaving no ambiguity about usage context.

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