Build Transmission Header
build_transmission_headerBuilds and validates the DatiTrasmissione block for a FatturaPA header, checking format, recipient code, and PEC requirements before XML generation.
Instructions
Build the DatiTrasmissione block required in every FatturaPA header.
Use this as step 3 in the invoice generation workflow, after generate_progressivo_invio() and before validate_cedente_prestatore(). Use lookup_codice_destinatario() first to confirm the recipient code format.
Validates: formato_trasmissione must be 'FPA12' or 'FPR12'; progressivo_invio must be 1–10 alphanumeric characters; pec_destinatario is required when codice_destinatario is '0000000'.
On success returns {'DatiTrasmissione': {...}} ready to pass to generate_fattura_xml(). On failure returns {'error': ''} — do not proceed to XML generation.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"id_paese": "<id_paese>",
"id_codice": "<id_codice>",
"progressivo_invio": "<progressivo_invio>",
"formato_trasmissione": "<formato_trasmissione>",
"codice_destinatario": "<codice_destinatario>"
},
"name": "build_transmission_header"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id_paese | Yes | Two-letter ISO 3166-1 country code of the transmitter (e.g. 'IT'). Usually 'IT' for Italian entities. | |
| id_codice | Yes | Tax identifier of the transmitter: Partita IVA (11 digits) for Italian entities, or foreign tax ID (max 28 chars) for cross-border. | |
| pec_destinatario | No | PEC (certified email) address of the recipient. Required only when codice_destinatario is '0000000'. | |
| progressivo_invio | Yes | Unique sequential send identifier, max 10 alphanumeric characters. Use generate_progressivo_invio() to obtain one automatically. | |
| codice_destinatario | Yes | SDI recipient code: 6-char for PA offices (IPA code, FPA12), 7-char for B2B intermediaries (FPR12), or '0000000' (7 zeros) for PEC routing. Use lookup_codice_destinatario() to validate the code first. | |
| formato_trasmissione | Yes | Transmission format: 'FPA12' for invoices to Public Administration (PA), 'FPR12' for invoices to private parties (B2B / B2C). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||