Skip to main content
Glama
cmendezs

mcp-fattura-elettronica-it

build_dati_generali

Build the mandatory DatiGenerali block for an Italian electronic invoice (FatturaPA). Use after validating the cessionario and before adding line items. Validates document type, date, and invoice number.

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

Behavior5/5

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

Without annotations, the description fully discloses behavior: it validates input fields, returns success or error objects, and notes that causale can appear multiple times but accepts a single string. This covers all necessary transparency.

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?

Front-loaded with overall purpose, then workflow step, then specific use cases, validation, and return format. Each sentence adds value with no redundancy.

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, validation rules, workflow integration, and the existence of an output schema (described in return format), the description covers all aspects necessary for an agent to use the 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 coverage is 100%, but description adds clarifying context: explains use of id_documento_riferimento and data_documento_riferimento for credit/debit notes, validation rules for tipo_documento and data, and causale multiplicity. Adds value 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?

Clearly states the tool builds the DatiGenerali block required in every FatturaElettronicaBody, specifies its place in the workflow (step 6 after validate_cessionario, before add_linea_dettaglio), and distinguishes from siblings by referencing specific workflow context.

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 tells when to use (step 6), prerequisites (validate_cessionario, get_tipo_documento_codes), and provides conditional instructions for credit/debit notes (setting id_documento_riferimento and data_documento_riferimento). Also includes validation rules and expected outcomes.

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