get_invoice_requirements
Retrieve mandatory fields for a valid VAT invoice in any European country. Use to generate compliant invoices or validate invoice templates.
Instructions
Returns the mandatory fields required on a valid VAT invoice for a given European country, as defined by EU VAT Directive 2006/112/EC and local implementations. Returns { country, mandatory_fields: [], optional_fields: [], notes }. Use when generating invoices for EU customers, validating invoice templates, or building invoice compliance checks in agent workflows. Information provided as reference only — not legal advice.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| country_code | Yes | Two-letter ISO country code. Example: 'PT', 'DE', 'FR' |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| country | No | ||
| mandatory_fields | No | ||
| optional_fields | No | ||
| notes | No | ||
| disclaimer | No | ||
| error | No |
Implementation Reference
- index.js:448-481 (registration)Registration of the 'get_invoice_requirements' tool via server.registerTool.
server.registerTool("get_invoice_requirements", { description: "Returns the mandatory fields required on a valid VAT invoice for a given European country, as defined by EU VAT Directive 2006/112/EC and local implementations. Returns { country, mandatory_fields: [], optional_fields: [], notes }. Use when generating invoices for EU customers, validating invoice templates, or building invoice compliance checks in agent workflows. Information provided as reference only — not legal advice.", inputSchema: { country_code: z.string().describe("Two-letter ISO country code. Example: 'PT', 'DE', 'FR'") }, outputSchema: { country: z.string().optional(), mandatory_fields: z.array(z.string()).optional(), optional_fields: z.array(z.string()).optional(), notes: z.string().optional(), disclaimer: z.string().optional(), error: z.string().optional() }, annotations: { title: "Get Invoice Mandatory Fields", readOnlyHint: true, idempotentHint: true, openWorldHint: false } }, async ({ country_code }) => { const baseFields = [ "Sequential invoice number", "Invoice date", "Supplier name and address", "Supplier VAT/tax number", "Customer name and address", "Description of goods or services", "Quantity and unit price", "VAT rate applied", "VAT amount", "Total amount excluding VAT", "Total amount including VAT" ]; const requirements = { PT: { country: "Portugal", mandatory_fields: [...baseFields, "Customer NIF (for B2B)", "ATCUD code (since 2023)", "Invoice series and sequence"], optional_fields: ["Customer VAT number (B2C)", "Payment method"], notes: "AT (Autoridade Tributária) requires certified invoicing software. ATCUD is mandatory since 2023." }, ES: { country: "Spain", mandatory_fields: [...baseFields, "Customer NIF/CIF (for B2B)", "Place of supply if different"], optional_fields: ["Customer VAT number (B2C)", "Discount details"], notes: "Factura electrónica mandatory for B2G. Verifactu system being phased in 2024-2025." }, FR: { country: "France", mandatory_fields: [...baseFields, "Customer SIRET (for B2B)", "Delivery address if different", "Payment terms"], optional_fields: ["Discount details", "Purchase order reference"], notes: "Facture électronique mandatory for B2G since 2017. B2B e-invoicing rollout 2024-2026." }, DE: { country: "Germany", mandatory_fields: [...baseFields, "Customer VAT number (for B2B intra-EU)", "Tax point date if different from invoice date"], optional_fields: ["Bank details", "Skonto terms"], notes: "ZUGFeRD/XRechnung format required for B2G since 2020. B2B e-invoicing from 2025." }, IT: { country: "Italy", mandatory_fields: [...baseFields, "Customer Codice Fiscale or Partita IVA", "SDI recipient code (codice destinatario)", "Progressive number"], optional_fields: ["CUP/CIG codes (for public contracts)"], notes: "Fattura elettronica mandatory for ALL B2B and B2C since 2019 via SDI system." }, NL: { country: "Netherlands", mandatory_fields: [...baseFields, "Customer KVK number (recommended for B2B)", "BTW number (VAT)"], optional_fields: ["IBAN for payment", "Reference number"], notes: "E-invoicing mandatory for B2G (PEPPOL). B2B e-invoicing encouraged." }, UK: { country: "United Kingdom", mandatory_fields: [...baseFields, "Supplier VAT registration number", "Tax point (time of supply)"], optional_fields: ["Customer VAT number", "Unique customer reference"], notes: "Post-Brexit UK VAT rules apply. Making Tax Digital (MTD) requires digital records." }, BE: { country: "Belgium", mandatory_fields: [...baseFields, "Supplier VAT number (BE format)", "Customer VAT number (for B2B)"], optional_fields: ["Discount details", "Payment reference"], notes: "E-invoicing mandatory for B2G. B2B e-invoicing mandatory from 2026." }, }; const code = country_code.toUpperCase(); const data = requirements[code]; if (!data) return { content: [{ type: "text", text: JSON.stringify({ error: `Country ${code} not found. Available: ${Object.keys(requirements).join(", ")}`, note: "Reference only — not legal advice." }) }] }; return { content: [{ type: "text", text: JSON.stringify({ ...data, disclaimer: "Reference information only — not legal advice. Verify with a qualified professional or tax authority." }) }] }; }); - index.js:453-481 (handler)Handler function that returns mandatory invoice fields for a given European country based on EU VAT Directive 2006/112/EC.
}, async ({ country_code }) => { const baseFields = [ "Sequential invoice number", "Invoice date", "Supplier name and address", "Supplier VAT/tax number", "Customer name and address", "Description of goods or services", "Quantity and unit price", "VAT rate applied", "VAT amount", "Total amount excluding VAT", "Total amount including VAT" ]; const requirements = { PT: { country: "Portugal", mandatory_fields: [...baseFields, "Customer NIF (for B2B)", "ATCUD code (since 2023)", "Invoice series and sequence"], optional_fields: ["Customer VAT number (B2C)", "Payment method"], notes: "AT (Autoridade Tributária) requires certified invoicing software. ATCUD is mandatory since 2023." }, ES: { country: "Spain", mandatory_fields: [...baseFields, "Customer NIF/CIF (for B2B)", "Place of supply if different"], optional_fields: ["Customer VAT number (B2C)", "Discount details"], notes: "Factura electrónica mandatory for B2G. Verifactu system being phased in 2024-2025." }, FR: { country: "France", mandatory_fields: [...baseFields, "Customer SIRET (for B2B)", "Delivery address if different", "Payment terms"], optional_fields: ["Discount details", "Purchase order reference"], notes: "Facture électronique mandatory for B2G since 2017. B2B e-invoicing rollout 2024-2026." }, DE: { country: "Germany", mandatory_fields: [...baseFields, "Customer VAT number (for B2B intra-EU)", "Tax point date if different from invoice date"], optional_fields: ["Bank details", "Skonto terms"], notes: "ZUGFeRD/XRechnung format required for B2G since 2020. B2B e-invoicing from 2025." }, IT: { country: "Italy", mandatory_fields: [...baseFields, "Customer Codice Fiscale or Partita IVA", "SDI recipient code (codice destinatario)", "Progressive number"], optional_fields: ["CUP/CIG codes (for public contracts)"], notes: "Fattura elettronica mandatory for ALL B2B and B2C since 2019 via SDI system." }, NL: { country: "Netherlands", mandatory_fields: [...baseFields, "Customer KVK number (recommended for B2B)", "BTW number (VAT)"], optional_fields: ["IBAN for payment", "Reference number"], notes: "E-invoicing mandatory for B2G (PEPPOL). B2B e-invoicing encouraged." }, UK: { country: "United Kingdom", mandatory_fields: [...baseFields, "Supplier VAT registration number", "Tax point (time of supply)"], optional_fields: ["Customer VAT number", "Unique customer reference"], notes: "Post-Brexit UK VAT rules apply. Making Tax Digital (MTD) requires digital records." }, BE: { country: "Belgium", mandatory_fields: [...baseFields, "Supplier VAT number (BE format)", "Customer VAT number (for B2B)"], optional_fields: ["Discount details", "Payment reference"], notes: "E-invoicing mandatory for B2G. B2B e-invoicing mandatory from 2026." }, }; const code = country_code.toUpperCase(); const data = requirements[code]; if (!data) return { content: [{ type: "text", text: JSON.stringify({ error: `Country ${code} not found. Available: ${Object.keys(requirements).join(", ")}`, note: "Reference only — not legal advice." }) }] }; return { content: [{ type: "text", text: JSON.stringify({ ...data, disclaimer: "Reference information only — not legal advice. Verify with a qualified professional or tax authority." }) }] }; }); - index.js:450-452 (schema)Input and output schemas for get_invoice_requirements tool, defined with Zod schemas.
inputSchema: { country_code: z.string().describe("Two-letter ISO country code. Example: 'PT', 'DE', 'FR'") }, outputSchema: { country: z.string().optional(), mandatory_fields: z.array(z.string()).optional(), optional_fields: z.array(z.string()).optional(), notes: z.string().optional(), disclaimer: z.string().optional(), error: z.string().optional() }, annotations: { title: "Get Invoice Mandatory Fields", readOnlyHint: true, idempotentHint: true, openWorldHint: false } - index.js:454-466 (helper)Base mandatory invoice fields common across all countries, used as a helper data structure.
const baseFields = [ "Sequential invoice number", "Invoice date", "Supplier name and address", "Supplier VAT/tax number", "Customer name and address", "Description of goods or services", "Quantity and unit price", "VAT rate applied", "VAT amount", "Total amount excluding VAT", "Total amount including VAT" ];