Skip to main content
Glama
cmendezs

mcp-fattura-elettronica-it

build_dati_generali

Create the required DatiGenerali block for Italian electronic invoices by specifying document type, date, number, and currency. Validate TD codes and include original invoice references 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
dataYesInvoice date in ISO 8601 format (YYYY-MM-DD), e.g. '2026-01-15'. Must not be a future date for ordinary invoices.
divisaNoISO 4217 currency code. Default 'EUR'. Other currencies for cross-border invoices.EUR
numeroYesInvoice number (Numero), max 20 alphanumeric chars. Must be unique and sequential per fiscal year.
causaleNoFree-text description/reason for the invoice (Causale), max 200 chars each. Pass a single string or a list of strings for multiple Causale elements. The XSD allows maxOccurs='unbounded'.
tipo_documentoYesDocument type code TD01–TD28. Use get_tipo_documento_codes() for the full list. Most invoices use TD01 (standard invoice).
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

Behavior5/5

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

With no annotations, the description carries the full behavioral burden. It reveals that the tool validates input (TD01–TD28, YYYY-MM-DD data, 20-char numero), enforces a workflow precondition, sets reference fields for credit/debit notes, and returns either {'DatiGenerali': {...}} or {'error': '<reason>'}. This gives a clear picture of side effects and failure modes.

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?

Every sentence adds a distinct piece of information: the purpose, the workflow position, how to select the TD code, credit/debit note required fields, validation rules, and return shapes. It is dense but not redundant, with critical instruction front-loaded.

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 schema covers all parameters and the output schema is declared, the description fills the remaining gaps: how the block fits into the larger generation workflow, relationship with get_tipo_documento_codes, special handling for credit/debit notes, validation rules, and success/error return shapes. Nothing an agent would need to call this tool correctly is missing.

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?

The schema already covers all 8 parameters with descriptions, so baseline is 3. The description adds meaningful conditional semantics beyond the schema: credit notes use TD04, professional fee invoices use TD06, and id_documento_riferimento/data_documento_riferimento must be used together for TD04/TD05. It also clarifies that divisa defaults to EUR for cross-border invoices, going beyond the schema.

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 uses the specific verb 'Build' with the resource 'DatiGenerali block required in every FatturaElettronicaBody', making its purpose unambiguous and distinct from sibling tools that build other blocks or validate parts of an invoice. It also places the tool in a named workflow, further identifying its role.

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?

It explicitly places the tool in step 6 of the workflow, identifies the previous (validate_cessionario) and next (add_linea_dettaglio) steps, and mandates calling get_tipo_documento_codes() first. It even gives conditional guidance for credit notes (TD04) and debit notes (TD05) regarding reference identifiers, so an agent knows exactly when and how to invoke it.

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