Skip to main content
Glama

Imperio — Italian Tax & Compliance Tools

INTRASTAT: compose and validate sections

intrastat_compose
Read-onlyIdempotent

Composes the SECTIONS of the Italian INTRASTAT summary listing from transaction lines, assigning each line to the right section (INTRA-1bis sales of goods, 1ter corrections, 1quater services rendered, 1quinquies corrections, 1sexies call-off stock; INTRA-2bis purchases of goods, 2ter, 2quater services received, 2quinquies) and VALIDATING them: allowed Member State (Northern Ireland XI only for GOODS; San Marino and the United Kingdom are out of scope), counterparty VAT number (format per Member State + checksum for Italian ones), 8-digit combined nomenclature (or the simplified code 99500000), format of the nature of transaction and required fields per section. Returns the populated sections, the totals, the deadline and a text summary for review. ⚠️ It does NOT generate the ELECTRONIC file for the customs telematic service (Intr@Web / ADM): the official record layout cannot be reproduced from a verifiable public source, so it was not invented. What you get is a data structure + summary, to be transferred to the official channel. No silent defaults: a missing required field produces an explicit error, never an arbitrary fill-in. VAT numbers are validated OFFLINE (format and checksum): for the live VIES check of the counterparty use verify_payee. Determine the frequency first with intrastat_periodicity. Indicative, it does not replace the accountant or customs broker.

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": {
      "anno": "<anno>",
      "mese": "<mese>",
      "righe": "<righe>"
    },
    "name": "intrastat_compose"
  }
}

Input Schema

NameRequiredDescriptionDefault
annoYesYear of the reference period (the current forms apply from 2022).
meseYesMonth of the reference period (1–12). With quarterly frequency it identifies the quarter.
righeYesTransaction lines to summarise. Maximum 25 on the anonymous surface (the authenticated API has no such limit). Lines of different flows/categories can coexist: each ends up in its own section. Per-line rules (also encoded as if/then in the item schema): categoria='beni' requires nomenclatura_combinata; categoria='servizi' requires codice_servizio, modalita_erogazione and modalita_incasso; rettifica=true requires anno_riferimento_rettifica. A negative ammontare is allowed only on a rettifica line, and call_off_stock only on cessioni of beni (never together with rettifica). A line breaking a rule is rejected with an error naming the line.
periodicitaNoFiling frequency of the listing — determine it with `intrastat_periodicity`. With 'nessun_obbligo' the call is REJECTED with an explanation: below the threshold the listing is not filed.mensile
partita_iva_dichiaranteNoItalian VAT number of the filer (11 digits, optional). If provided it is validated with the checksum.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / properties / righe / description
      Previous value: -"Transaction lines to summarise. Maximum 25 on the anonymous surface (the authenticated API has no such limit). Lines of different flows/categories can coexist: each ends up in its own section."New value: +"Transaction lines to summarise. Maximum 25 on the anonymous surface (the authenticated API has no such limit). Lines of different flows/categories can coexist: each ends up in its own section. Per-line rules (also encoded as if/then in the item schema): categoria='beni' requires nomenclatura_combinata; categoria='servizi' requires codice_servizio, modalita_erogazione and modalita_incasso; rettifica=true requires anno_riferimento_rettifica. A negative ammontare is allowed only on a rettifica line, and call_off_stock only on cessioni of beni (never together with rettifica). A line breaking a rule is rejected with an error naming the line."
  2. Changed22 schema fields changed
    • changedInput schema / properties / anno / description
      Previous value: -"Anno del periodo di riferimento (i modelli vigenti decorrono dal 2022)."New value: +"Year of the reference period (the current forms apply from 2022)."
    • changedInput schema / properties / mese / description
      Previous value: -"Mese del periodo di riferimento (1–12). Con periodicità trimestrale individua il trimestre."New value: +"Month of the reference period (1–12). With quarterly frequency it identifies the quarter."
    • changedInput schema / properties / partita_iva_dichiarante / description
      Previous value: -"Partita IVA italiana del soggetto obbligato (11 cifre, opzionale). Se fornita viene validata col checksum."New value: +"Italian VAT number of the filer (11 digits, optional). If provided it is validated with the checksum."
    • changedInput schema / properties / periodicita / description
      Previous value: -"Periodicità dell'elenco — determinala con `intrastat_periodicity`. Con 'nessun_obbligo' la chiamata viene RIFIUTATA con una spiegazione: sotto soglia l'elenco non va presentato."New value: +"Filing frequency of the listing — determine it with `intrastat_periodicity`. With 'nessun_obbligo' the call is REJECTED with an explanation: below the threshold the listing is not filed."
    • changedInput schema / properties / righe / description
      Previous value: -"Righe di operazione da riepilogare. Massimo 25 sulla superficie anonima (l'API autenticata non ha questo limite). Righe di flussi/categorie diversi possono coesistere: ognuna finisce nella sua sezione."New value: +"Transaction lines to summarise. Maximum 25 on the anonymous surface (the authenticated API has no such limit). Lines of different flows/categories can coexist: each ends up in its own section."
    • changedInput schema / properties / righe / items / properties / ammontare / description
      Previous value: -"Ammontare delle operazioni in EURO. Negativo ammesso solo se rettifica=true."New value: +"Amount of the transactions in EURO. Negative allowed only if rettifica=true."
    • changedInput schema / properties / righe / items / properties / anno_riferimento_rettifica / description
      Previous value: -"Obbligatorio se rettifica=true: anno del periodo rettificato."New value: +"Required if rettifica=true: year of the corrected period."
    • changedInput schema / properties / righe / items / properties / call_off_stock / description
      Previous value: -"Solo cessioni di BENI: regime call-off stock (art. 17-bis Dir. 2006/112/CE) → sezione INTRA-1sexies."New value: +"Sales of GOODS only: call-off stock regime (art. 17-bis Dir. 2006/112/EC) → section INTRA-1sexies."
    • changedInput schema / properties / righe / items / properties / categoria / description
      Previous value: -"Determina quali campi sono obbligatori: i campi BENI e i campi SERVIZI si escludono."New value: +"Decides which fields are required: GOODS (beni) fields and SERVICES (servizi) fields are mutually exclusive."
    • changedInput schema / properties / righe / items / properties / codice_servizio / description
      Previous value: -"Solo SERVIZI: codice CPA a 6 cifre. Validato nel formato, non l'esistenza in tabella CPA."New value: +"SERVICES only: 6-digit CPA code. The format is validated, not its existence in the CPA table."
    • changedInput schema / properties / righe / items / properties / flusso / description
      Previous value: -"cessioni = INTRA-1 (attive) · acquisti = INTRA-2 (passive)."New value: +"cessioni = INTRA-1 (outgoing) · acquisti = INTRA-2 (incoming)."
    • changedInput schema / properties / righe / items / properties / massa_netta_kg / description
      Previous value: -"Solo BENI: massa netta in kg."New value: +"GOODS only: net mass in kg."
    • changedInput schema / properties / righe / items / properties / modalita_erogazione / description
      Previous value: -"Solo SERVIZI: 'I' istantanea · 'R' a più riprese."New value: +"SERVICES only: 'I' instantaneous · 'R' recurring."
    • changedInput schema / properties / righe / items / properties / modalita_incasso / description
      Previous value: -"Solo SERVIZI: 'B' bonifico · 'A' accredito · 'X' altro."New value: +"SERVICES only: 'B' bank transfer · 'A' credit · 'X' other."
    • changedInput schema / properties / righe / items / properties / natura_transazione / description
      Previous value: -"Solo BENI: codice natura della transazione — 1 cifra (colonna A) oppure 2 cifre (colonne A+B, obbligatorie oltre € 20.000.000 di scambi nell'anno precedente). Si valida SOLO il formato: le descrizioni dei codici sono l'Allegato XI alla Det. ADM 493869/RU/2021, non riproducibile da fonte testuale verificabile, e non vengono inventate."New value: +"GOODS only: nature of transaction code — 1 digit (column A) or 2 digits (columns A+B, required above €20,000,000 of trade in the previous year). ONLY the format is validated: the code descriptions are Annex XI to Det. ADM 493869/RU/2021, not reproducible from a verifiable text source, and are not invented."
    • changedInput schema / properties / righe / items / properties / nomenclatura_combinata / description
      Previous value: -"Solo BENI: codice NC a 8 cifre. Per spedizioni di valore inferiore a € 1.000 è ammesso il codice unico 99500000. Se ne valida il FORMATO, non l'esistenza nella NC dell'anno (la tabella NC è annuale e non è in repository)."New value: +"GOODS only: 8-digit CN code. For consignments worth less than €1,000 the single code 99500000 is allowed. The FORMAT is validated, not its existence in the year's CN (the CN table is annual and not in the repository)."
    • changedInput schema / properties / righe / items / properties / paese_controparte / description
      Previous value: -"Codice ISO2 dello Stato membro della controparte (es. DE, FR, ES; EL per la Grecia, non GR). 'XI' (Irlanda del Nord) è ammesso SOLO per i beni. SM (San Marino) e GB sono fuori ambito e vengono rifiutati."New value: +"ISO2 code of the counterparty's Member State (e.g. DE, FR, ES; EL for Greece, not GR). 'XI' (Northern Ireland) is allowed ONLY for goods. SM (San Marino) and GB are out of scope and rejected."
    • changedInput schema / properties / righe / items / properties / paese_destinazione / description
      Previous value: -"Solo BENI: paese di destinazione/provenienza della merce (ISO2)."New value: +"GOODS only: country of destination/provenance of the goods (ISO2)."
    • changedInput schema / properties / righe / items / properties / paese_origine / description
      Previous value: -"Solo BENI: paese di origine della merce (ISO2)."New value: +"GOODS only: country of origin of the goods (ISO2)."
    • changedInput schema / properties / righe / items / properties / partita_iva_controparte / description
      Previous value: -"Partita IVA della controparte, con o senza prefisso paese (es. DE123456789 o 123456789). Validata sul formato dello Stato membro; per le italiane anche col checksum. Nessuna interrogazione VIES."New value: +"Counterparty VAT number, with or without country prefix (e.g. DE123456789 or 123456789). Validated against the Member State format; Italian ones also with the checksum. No VIES query."
    • changedInput schema / properties / righe / items / properties / rettifica / description
      Previous value: -"True se la riga rettifica un periodo PRECEDENTE → sezioni ter/quinquies. Richiede `anno_riferimento_rettifica`. Solo sulle rettifiche è ammesso un ammontare negativo."New value: +"True if the line corrects a PREVIOUS period → ter/quinquies sections. Requires `anno_riferimento_rettifica`. Only corrections may have a negative amount."
    • changedInput schema / properties / righe / items / properties / riferimento / description
      Previous value: -"Riferimento libero (es. numero fattura). Serve solo alla tua tracciabilità: non fa parte dell'elenco."New value: +"Free reference (e.g. invoice number). Only for your own traceability: it is not part of the listing."
  3. Changed3 schema fields changed
    • addedInput schema / properties / righe / items / allOf
      Added value: +[
      +  {
      +    "if": {
      +      "properties": {
      +        "categoria": {
      +          "const": "beni"
      +        }
      +      },
      +      "required": [
      +        "categoria"
      +      ]
      +    },
      +    "then": {
      +      "required": [
      +        "nomenclatura_combinata"
      +      ]
      +    }
      +  },
      +  {
      +    "if": {
      +      "properties": {
      +        "categoria": {
      +          "const": "servizi"
      +        }
      +      },
      +      "required": [
      +        "categoria"
      +      ]
      +    },
      +    "then": {
      +      "required": [
      +        "codice_servizio",
      +        "modalita_erogazione",
      +        "modalita_incasso"
      +      ]
      +    }
      +  },
      +  {
      +    "if": {
      +      "properties": {
      +        "rettifica": {
      +          "const": true
      +        }
      +      },
      +      "required": [
      +        "rettifica"
      +      ]
      +    },
      +    "then": {
      +      "required": [
      +        "anno_riferimento_rettifica"
      +      ]
      +    }
      +  }
      +]
    • addedInput schema / properties / righe / items / properties / codice_servizio / pattern
      Added value: +"^\\d{6}$"
    • addedInput schema / properties / righe / items / properties / nomenclatura_combinata / pattern
      Added value: +"^\\d{8}$"
  4. Added

TDQS

A4.6/5.0
Behavior5/5

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

Beyond the readOnly/idempotent/openWorld annotations, the description discloses the no-silent-defaults error policy, per-line rejection that names the offending line, offline-only VAT validation, the 25-line anonymous ceiling, and that the output is a data structure plus summary rather than a transmission-ready file. These are the operational facts an agent needs before calling.

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 core purpose and the 'does not generate the electronic file' caveat are front-loaded, and the length is justified by a genuinely complex tool. There is some redundancy — section codes and per-line rules are repeated from the schema — plus heavy ALL-CAPS emphasis and a warning glyph, which cost a point.

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?

For a complex multi-line composer with no output schema, the description still states what comes back (populated sections, totals, deadline, text summary for review) and flags the verification limits (CN and transaction-nature codes validated for format only). Nothing essential to correct invocation appears missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents year, month, line fields, if/then requirements, enums and the 99500000 simplification. The description restates rather than extends those semantics, adding little the schema does not already say. Baseline 3 is appropriate.

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?

States a specific verb and resource — composing and validating the sections of the Italian INTRASTAT summary listing from transaction lines — and enumerates the target sections (INTRA-1bis through 2quinquies). It draws an explicit boundary against adjacent tools (verify_payee, intrastat_periodicity) and against the electronic-file generation it does not perform.

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?

Gives explicit routing: determine frequency first with `intrastat_periodicity`, use `verify_payee` for live VIES checks, and note that 'nessun_obbligo' causes rejection. It also states the negative case clearly — it does NOT produce the Intr@Web/ADM electronic file — so an agent knows when to look elsewhere.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources