Skip to main content
Glama
cmendezs

mcp-fattura-elettronica-it

build_dati_generali

Builds the mandatory DatiGenerali block for Italian electronic invoices. Provide document type, date, and invoice number; optionally reference the original invoice for credit or debit notes.

Instructions

Build the DatiGenerali block required in every FatturaElettronicaBody.

Use this as step 6 in the invoice generation workflow, after validate_cessionario() and before add_linea_dettaglio(). Call get_tipo_documento_codes() first to select the correct TD code (most invoices use TD01; credit notes use TD04; professional fee invoices use TD06).

For credit notes (TD04) or debit notes (TD05), set id_documento_riferimento to the original invoice number and data_documento_riferimento to its issue date.

Validates: tipo_documento must be a valid TD01–TD28 code; data must be YYYY-MM-DD; numero must not exceed 20 characters.

On success returns {'DatiGenerali': {...}} ready for generate_fattura_xml(). On failure returns {'error': ''}.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tipo_documentoYesDocument type code TD01–TD28. Use get_tipo_documento_codes() for the full list. Most invoices use TD01 (standard invoice).
dataYesInvoice date in ISO 8601 format (YYYY-MM-DD), e.g. '2026-01-15'. Must not be a future date for ordinary invoices.
numeroYesInvoice number (Numero), max 20 alphanumeric chars. Must be unique and sequential per fiscal year.
divisaNoISO 4217 currency code. Default 'EUR'. Other currencies for cross-border invoices.EUR
causaleNoOptional free-text description/reason for the invoice (Causale), max 200 chars. Can appear multiple times — pass a single string here.
rif_numero_lineaNoLine number reference for credit/debit notes linking back to the original invoice.
id_documento_riferimentoNoNumber of the original invoice (for credit notes TD04, debit notes TD05, etc.).
data_documento_riferimentoNoDate of the original invoice (YYYY-MM-DD), for TD04/TD05.

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 validation rules (tipo_documento must be TD01-TD28, date YYYY-MM-DD, numero max 20 chars) and return format (success vs error). It does not mention idempotency or side effects, but the behavior is clearly implied as a creation operation.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is six sentences with a logical flow: purpose, workflow position, prerequisites, special cases, validation, return values. Every sentence adds value, no redundancy. Front-loaded with purpose.

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 8 parameters, no annotations, and an output schema (implied by return description), the description covers all essential aspects: what the tool does, when to use it, parameter semantics, validation rules, and return format. It is complete for an agent to select and invoke 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 coverage is 100%, baseline 3. The description adds context beyond the schema: explains the role of id_documento_riferimento and data_documento_riferimento for credit/debit notes, and notes common usage (e.g., 'most invoices use TD01'). This enriches agent understanding.

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: 'Build the DatiGenerali block required in every FatturaElettronicaBody.' It uses a specific verb ('Build') and resource ('DatiGenerali block'), and differentiates from siblings by specifying its role in the workflow step 6, after validate_cessionario() and before add_linea_dettaglio().

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?

Provides explicit when-to-use instructions: 'Use this as step 6... after validate_cessionario() and before add_linea_dettaglio().' It also tells when not to use it implicitly by specifying prerequisites like calling get_tipo_documento_codes() first, and gives special handling for credit notes (TD04) and debit notes (TD05).

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