Skip to main content
Glama
cmendezs

mcp-fattura-elettronica-it

compute_totali

Computes VAT summary totals (DatiRiepilogo) from invoice line items grouped by VAT rate and nature, providing imponibile, imposta, and total amounts.

Instructions

Compute DatiRiepilogo VAT summary totals grouped by AliquotaIVA and Natura.

Use this as step 8 in the invoice generation workflow, after all add_linea_dettaglio() calls and before generate_fattura_xml(). Pass the raw line values (not the DettaglioLinee dicts): each item needs 'prezzo_totale' (float), 'aliquota_iva' (float), and optionally 'natura' (str).

Groups lines by (aliquota_iva, natura) pair, sums imponibile, and computes imposta = imponibile × aliquota / 100 (rounded HALF_UP to 2 decimal places). EsigibilitaIVA defaults to 'I' (immediata) for all groups.

Always succeeds (empty list produces empty DatiRiepilogo). Returns: {'DatiRiepilogo': [...], 'totale_imponibile': str, 'totale_imposta': str, 'totale_fattura': str}. Pass 'DatiRiepilogo' directly to generate_fattura_xml() as dati_riepilogo.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
lineeYesList of line item dicts, each containing at least: 'prezzo_totale' (float), 'aliquota_iva' (float), and optionally 'natura' (str). These are the raw values, not the DettaglioLinee dicts.

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 behavior: it groups lines, sums imponibile, computes imposta with HALF_UP rounding, defaults EsigibilitaIVA to 'I', and states it always succeeds even with empty input. The exact return structure is also described.

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 the purpose and well-structured, but it is slightly verbose. However, every sentence adds value, and the organization is logical, making it easy to parse.

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 complexity of VAT summary computation and the existence of an output schema, the description is complete. It covers input format, grouping logic, rounding, defaults, edge case handling (empty list), and the return structure, leaving no significant gaps.

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%, but the description adds significant meaning beyond the schema by clarifying that 'linee' must be raw values (not DettaglioLinee dicts) and specifying required fields and optional 'natura'. This extra context justifies 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 the tool computes VAT summary totals grouped by AliquotaIVA and Natura, specifying it as step 8 in a workflow. It distinguishes itself from sibling tools by explicitly noting it uses raw line values, not DettaglioLinee dicts, which differentiates it from add_linea_dettaglio and others.

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 explains when to use the tool (step 8 after add_linea_dettaglio() and before generate_fattura_xml()) and what input to pass (raw line values). It does not explicitly state when not to use it, but the workflow context and required input format provide clear direction.

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