get_einvoicing_rules
Retrieves current e-invoicing obligations for any European country. Provides mandatory status for B2G, B2B, B2C, required formats, and implementation timeline to ensure compliance.
Instructions
Returns the current e-invoicing (electronic invoicing) obligations for a given European country — whether it is mandatory for B2G (business-to-government), B2B (business-to-business), or B2C transactions, the required formats, and implementation timeline. Returns { country, b2g_mandatory, b2b_mandatory, b2c_mandatory, formats, timeline, platform, notes }. Use when building invoice generation systems, determining compliance requirements for EU customers, or automating invoice submission workflows.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| country_code | Yes | Two-letter ISO country code. Example: 'IT', 'DE', 'FR' |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| country | No | ||
| b2g_mandatory | No | ||
| b2b_mandatory | No | ||
| b2c_mandatory | No | ||
| formats | No | ||
| platform | No | ||
| timeline | No | ||
| notes | No | ||
| disclaimer | No | ||
| error | No |
Implementation Reference
- index.js:508-531 (registration)The tool named 'get_einvoicing_rules' is registered using server.registerTool() on line 509. The registration includes the description, input/output schemas, and annotations.
// ── 21. Get E-Invoicing Rules ── server.registerTool("get_einvoicing_rules", { description: "Returns the current e-invoicing (electronic invoicing) obligations for a given European country — whether it is mandatory for B2G (business-to-government), B2B (business-to-business), or B2C transactions, the required formats, and implementation timeline. Returns { country, b2g_mandatory, b2b_mandatory, b2c_mandatory, formats, timeline, platform, notes }. Use when building invoice generation systems, determining compliance requirements for EU customers, or automating invoice submission workflows.", inputSchema: { country_code: z.string().describe("Two-letter ISO country code. Example: 'IT', 'DE', 'FR'") }, outputSchema: { country: z.string().optional(), b2g_mandatory: z.boolean().optional(), b2b_mandatory: z.boolean().optional(), b2c_mandatory: z.boolean().optional(), formats: z.array(z.string()).optional(), platform: z.string().optional(), timeline: z.string().optional(), notes: z.string().optional(), disclaimer: z.string().optional(), error: z.string().optional() }, annotations: { title: "Get E-Invoicing Rules", readOnlyHint: true, idempotentHint: true, openWorldHint: false } }, async ({ country_code }) => { const rules = { IT: { country: "Italy", b2g_mandatory: true, b2b_mandatory: true, b2c_mandatory: true, formats: ["FatturaPA (XML)", "SDI"], platform: "SDI (Sistema di Interscambio)", timeline: "B2G: 2014. B2B+B2C: January 2019.", notes: "Most advanced e-invoicing system in EU. All invoices must pass through SDI. Codice destinatario required." }, FR: { country: "France", b2g_mandatory: true, b2b_mandatory: true, b2c_mandatory: false, formats: ["Factur-X", "UBL 2.1", "CII"], platform: "Chorus Pro (B2G), PPF/PDP (B2B)", timeline: "B2G: 2017. B2B receipt: Sep 2026. B2B issuance: Sep 2026 (large) / Sep 2027 (SME).", notes: "Major reform. B2B mandatory from 2026-2027 depending on company size." }, DE: { country: "Germany", b2g_mandatory: true, b2b_mandatory: true, b2c_mandatory: false, formats: ["XRechnung", "ZUGFeRD", "PEPPOL BIS"], platform: "PEPPOL network (B2G)", timeline: "B2G: Nov 2020. B2B receive: Jan 2025. B2B send: Jan 2027.", notes: "B2B e-invoicing mandatory from 2025 (receive) and 2027 (send). EN 16931 standard required." }, ES: { country: "Spain", b2g_mandatory: true, b2b_mandatory: true, b2c_mandatory: false, formats: ["Facturae", "UBL", "PEPPOL"], platform: "FACe (B2G), Verifactu/SIF (B2B)", timeline: "B2G: 2015. B2B: 2025 (large companies), 2026 (SMEs) — Ley Crea y Crece.", notes: "Verifactu system being phased in. B2B mandatory pending final regulations." }, PT: { country: "Portugal", b2g_mandatory: true, b2b_mandatory: false, b2c_mandatory: false, formats: ["CIUS-PT", "UBL 2.1", "PEPPOL"], platform: "eSPap / PEPPOL", timeline: "B2G: 2021. B2B: not yet mandatory.", notes: "ATCUD code mandatory on all invoices since 2023. Certified invoicing software required." }, BE: { country: "Belgium", b2g_mandatory: true, b2b_mandatory: true, b2c_mandatory: false, formats: ["PEPPOL BIS", "UBL 2.1"], platform: "PEPPOL network", timeline: "B2G: 2020. B2B mandatory: Jan 2026.", notes: "B2B e-invoicing mandatory from January 2026 via PEPPOL network." }, NL: { country: "Netherlands", b2g_mandatory: true, b2b_mandatory: false, b2c_mandatory: false, formats: ["PEPPOL BIS", "UBL 2.1"], platform: "PEPPOL network", timeline: "B2G: 2019. B2B: not yet mandatory.", notes: "Strong PEPPOL adoption. Government actively promotes voluntary B2B e-invoicing." }, UK: { country: "United Kingdom", b2g_mandatory: false, b2b_mandatory: false, b2c_mandatory: false, formats: ["PEPPOL", "UBL"], platform: "No central platform", timeline: "No mandatory e-invoicing yet. HMRC consulting on introduction.", notes: "Post-Brexit, UK not bound by EU e-invoicing directive. Making Tax Digital (MTD) focuses on VAT records." }, SE: { country: "Sweden", b2g_mandatory: true, b2b_mandatory: false, b2c_mandatory: false, formats: ["PEPPOL BIS", "Svefaktura"], platform: "PEPPOL network", timeline: "B2G: 2019 (central govt), 2021 (local govt). B2B: not mandatory.", notes: "Sweden has one of highest PEPPOL adoption rates in Europe." }, PL: { country: "Poland", b2g_mandatory: true, b2b_mandatory: true, b2c_mandatory: false, formats: ["FA_VAT (XML)", "KSeF"], platform: "KSeF (Krajowy System e-Faktur)", timeline: "B2G: 2021. B2B mandatory: Feb 2026.", notes: "KSeF system. B2B e-invoicing mandatory from February 2026 after 2024 postponement." }, }; const code = country_code.toUpperCase(); const data = rules[code]; if (!data) return { content: [{ type: "text", text: JSON.stringify({ error: `Country ${code} not found. Available: ${Object.keys(rules).join(", ")}` }) }] }; return { content: [{ type: "text", text: JSON.stringify({ ...data, disclaimer: "Reference information only. E-invoicing regulations change frequently. Verify with official sources." }) }] }; }); - index.js:514-531 (handler)The handler function (async callback from line 514) executes the tool logic: it looks up e-invoicing rules in the 'rules' dictionary keyed by country code (IT, FR, DE, ES, PT, BE, NL, UK, SE, PL) and returns the matching data or an error.
}, async ({ country_code }) => { const rules = { IT: { country: "Italy", b2g_mandatory: true, b2b_mandatory: true, b2c_mandatory: true, formats: ["FatturaPA (XML)", "SDI"], platform: "SDI (Sistema di Interscambio)", timeline: "B2G: 2014. B2B+B2C: January 2019.", notes: "Most advanced e-invoicing system in EU. All invoices must pass through SDI. Codice destinatario required." }, FR: { country: "France", b2g_mandatory: true, b2b_mandatory: true, b2c_mandatory: false, formats: ["Factur-X", "UBL 2.1", "CII"], platform: "Chorus Pro (B2G), PPF/PDP (B2B)", timeline: "B2G: 2017. B2B receipt: Sep 2026. B2B issuance: Sep 2026 (large) / Sep 2027 (SME).", notes: "Major reform. B2B mandatory from 2026-2027 depending on company size." }, DE: { country: "Germany", b2g_mandatory: true, b2b_mandatory: true, b2c_mandatory: false, formats: ["XRechnung", "ZUGFeRD", "PEPPOL BIS"], platform: "PEPPOL network (B2G)", timeline: "B2G: Nov 2020. B2B receive: Jan 2025. B2B send: Jan 2027.", notes: "B2B e-invoicing mandatory from 2025 (receive) and 2027 (send). EN 16931 standard required." }, ES: { country: "Spain", b2g_mandatory: true, b2b_mandatory: true, b2c_mandatory: false, formats: ["Facturae", "UBL", "PEPPOL"], platform: "FACe (B2G), Verifactu/SIF (B2B)", timeline: "B2G: 2015. B2B: 2025 (large companies), 2026 (SMEs) — Ley Crea y Crece.", notes: "Verifactu system being phased in. B2B mandatory pending final regulations." }, PT: { country: "Portugal", b2g_mandatory: true, b2b_mandatory: false, b2c_mandatory: false, formats: ["CIUS-PT", "UBL 2.1", "PEPPOL"], platform: "eSPap / PEPPOL", timeline: "B2G: 2021. B2B: not yet mandatory.", notes: "ATCUD code mandatory on all invoices since 2023. Certified invoicing software required." }, BE: { country: "Belgium", b2g_mandatory: true, b2b_mandatory: true, b2c_mandatory: false, formats: ["PEPPOL BIS", "UBL 2.1"], platform: "PEPPOL network", timeline: "B2G: 2020. B2B mandatory: Jan 2026.", notes: "B2B e-invoicing mandatory from January 2026 via PEPPOL network." }, NL: { country: "Netherlands", b2g_mandatory: true, b2b_mandatory: false, b2c_mandatory: false, formats: ["PEPPOL BIS", "UBL 2.1"], platform: "PEPPOL network", timeline: "B2G: 2019. B2B: not yet mandatory.", notes: "Strong PEPPOL adoption. Government actively promotes voluntary B2B e-invoicing." }, UK: { country: "United Kingdom", b2g_mandatory: false, b2b_mandatory: false, b2c_mandatory: false, formats: ["PEPPOL", "UBL"], platform: "No central platform", timeline: "No mandatory e-invoicing yet. HMRC consulting on introduction.", notes: "Post-Brexit, UK not bound by EU e-invoicing directive. Making Tax Digital (MTD) focuses on VAT records." }, SE: { country: "Sweden", b2g_mandatory: true, b2b_mandatory: false, b2c_mandatory: false, formats: ["PEPPOL BIS", "Svefaktura"], platform: "PEPPOL network", timeline: "B2G: 2019 (central govt), 2021 (local govt). B2B: not mandatory.", notes: "Sweden has one of highest PEPPOL adoption rates in Europe." }, PL: { country: "Poland", b2g_mandatory: true, b2b_mandatory: true, b2c_mandatory: false, formats: ["FA_VAT (XML)", "KSeF"], platform: "KSeF (Krajowy System e-Faktur)", timeline: "B2G: 2021. B2B mandatory: Feb 2026.", notes: "KSeF system. B2B e-invoicing mandatory from February 2026 after 2024 postponement." }, }; const code = country_code.toUpperCase(); const data = rules[code]; if (!data) return { content: [{ type: "text", text: JSON.stringify({ error: `Country ${code} not found. Available: ${Object.keys(rules).join(", ")}` }) }] }; return { content: [{ type: "text", text: JSON.stringify({ ...data, disclaimer: "Reference information only. E-invoicing regulations change frequently. Verify with official sources." }) }] }; }); - index.js:511-512 (schema)The input schema for get_einvoicing_rules takes a 'country_code' string parameter (two-letter ISO code).
inputSchema: { country_code: z.string().describe("Two-letter ISO country code. Example: 'IT', 'DE', 'FR'") }, outputSchema: { country: z.string().optional(), b2g_mandatory: z.boolean().optional(), b2b_mandatory: z.boolean().optional(), b2c_mandatory: z.boolean().optional(), formats: z.array(z.string()).optional(), platform: z.string().optional(), timeline: z.string().optional(), notes: z.string().optional(), disclaimer: z.string().optional(), error: z.string().optional() }, - index.js:512-512 (schema)The output schema defines the return structure with optional fields: country, b2g_mandatory, b2b_mandatory, b2c_mandatory, formats, platform, timeline, notes, disclaimer, error.
outputSchema: { country: z.string().optional(), b2g_mandatory: z.boolean().optional(), b2b_mandatory: z.boolean().optional(), b2c_mandatory: z.boolean().optional(), formats: z.array(z.string()).optional(), platform: z.string().optional(), timeline: z.string().optional(), notes: z.string().optional(), disclaimer: z.string().optional(), error: z.string().optional() },