Skip to main content
Glama

specgrid-eu-compliance

Generate Peppol UBL or VeriFactu XML from JSON

einvoice_generate
Read-onlyIdempotent

Generate a complete, XML-escaped, cent-balanced EN 16931 Peppol BIS 3.0 UBL 2.1 XML invoice or Spanish AEAT VeriFactu sf:RegistroAlta XML block directly from JSON line items. Stateless, deterministic, read-only with zero storage; self-audits generated UBL XML and returns xml, totals {net, tax, gross, currency}, selfAuditValid, plus fingerprintSha256, qrValidationUrl, and qrSvg for VeriFactu format (returns isError=true if lines are empty or inputs invalid). Use when creating new compliant XML invoices from ERP/JSON data; use einvoice_validate to audit an existing XML, and pair with sepa_epc_qr for PDF payment QRs.

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": {
      "format": "<format>",
      "invoiceNumber": "<invoiceNumber>",
      "issueDate": "<issueDate>",
      "supplier": "<supplier>",
      "customer": "<customer>",
      "lines": "<lines>"
    },
    "name": "einvoice_generate"
  }
}

Input Schema

NameRequiredDescriptionDefault
linesYesOne or more invoice line items used to compute exact net, VAT, and gross totals.
formatYesTarget XML standard: "peppol_ubl_2_1" (EN 16931 / Peppol BIS 3.0 UBL 2.1) or "verifactu_registro_alta" (AEAT VeriFactu <sf:RegistroAlta> + SHA-256 + QR).
currencyNoISO 4217 3-letter currency code (defaults to "EUR").EUR
customerYesBuyer/recipient party metadata.
supplierYesSeller/issuer party metadata.
issueDateYesInvoice issue date in ISO YYYY-MM-DD format (e.g. "2026-11-29"); automatically converted to DD-MM-YYYY for VeriFactu.
paymentIbanNoOptional beneficiary SEPA IBAN included in UBL PaymentMeans (e.g. "ES9121000418450200051332").
previousHashNoOptional previous 64-char VeriFactu SHA-256 Huella when format is "verifactu_registro_alta" (leave "" for first record).
invoiceNumberYesUnique invoice series and identifier (e.g. "INV-2026/0105" or "PEPPOL-2026-0042").
generationTimestampNoOptional ISO-8601 timestamp with timezone offset for VeriFactu FechaHoraHusoGenRegistro (defaults to current UTC/offset time).

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed19 schema fields changed
    • addedInput schema / additionalProperties
      Added value: +false
    • addedInput schema / properties / currency / description
      Added value: +"ISO 4217 3-letter currency code (defaults to \"EUR\")."
    • addedInput schema / properties / customer / description
      Added value: +"Buyer/recipient party metadata."
    • addedInput schema / properties / customer / properties
      Added value: +{
      +  "countryCode": {
      +    "description": "ISO 3166-1 alpha-2 country code (e.g. \"DE\", \"ES\", \"FR\").",
      +    "type": "string"
      +  },
      +  "name": {
      +    "description": "Customer legal name.",
      +    "type": "string"
      +  },
      +  "taxId": {
      +    "description": "Customer NIF/CIF or EU VAT ID (e.g. \"DE123456789\").",
      +    "type": "string"
      +  }
      +}
    • addedInput schema / properties / customer / required
      Added value: +[
      +  "name",
      +  "taxId",
      +  "countryCode"
      +]
    • addedInput schema / properties / format / description
      Added value: +"Target XML standard: \"peppol_ubl_2_1\" (EN 16931 / Peppol BIS 3.0 UBL 2.1) or \"verifactu_registro_alta\" (AEAT VeriFactu <sf:RegistroAlta> + SHA-256 + QR)."
    • addedInput schema / properties / generationTimestamp / description
      Added value: +"Optional ISO-8601 timestamp with timezone offset for VeriFactu FechaHoraHusoGenRegistro (defaults to current UTC/offset time)."
    • addedInput schema / properties / invoiceNumber / description
      Added value: +"Unique invoice series and identifier (e.g. \"INV-2026/0105\" or \"PEPPOL-2026-0042\")."
    • changedInput schema / properties / issueDate / description
      Previous value: -"YYYY-MM-DD"New value: +"Invoice issue date in ISO YYYY-MM-DD format (e.g. \"2026-11-29\"); automatically converted to DD-MM-YYYY for VeriFactu."
    • addedInput schema / properties / lines / description
      Added value: +"One or more invoice line items used to compute exact net, VAT, and gross totals."
    • addedInput schema / properties / lines / items / properties
      Added value: +{
      +  "description": {
      +    "description": "Line item product or service description.",
      +    "type": "string"
      +  },
      +  "quantity": {
      +    "description": "Positive quantity (e.g. 2).",
      +    "type": "number"
      +  },
      +  "unitPrice": {
      +    "description": "Net unit price before VAT (e.g. 50.00).",
      +    "type": "number"
      +  },
      +  "vatRate": {
      +    "description": "VAT percentage rate as number (e.g. 21 for 21%, 0 for exempt).",
      +    "type": "number"
      +  }
      +}
    • addedInput schema / properties / lines / items / required
      Added value: +[
      +  "description",
      +  "quantity",
      +  "unitPrice",
      +  "vatRate"
      +]
    • addedInput schema / properties / lines / minItems
      Added value: +1
    • addedInput schema / properties / paymentIban / description
      Added value: +"Optional beneficiary SEPA IBAN included in UBL PaymentMeans (e.g. \"ES9121000418450200051332\")."
    • addedInput schema / properties / previousHash / default
      Added value: +""
    • addedInput schema / properties / previousHash / description
      Added value: +"Optional previous 64-char VeriFactu SHA-256 Huella when format is \"verifactu_registro_alta\" (leave \"\" for first record)."
    • addedInput schema / properties / supplier / description
      Added value: +"Seller/issuer party metadata."
    • addedInput schema / properties / supplier / properties
      Added value: +{
      +  "countryCode": {
      +    "description": "ISO 3166-1 alpha-2 country code (e.g. \"ES\", \"DE\", \"BE\").",
      +    "type": "string"
      +  },
      +  "name": {
      +    "description": "Supplier legal company name.",
      +    "type": "string"
      +  },
      +  "taxId": {
      +    "description": "Supplier NIF/CIF or EU VAT ID (e.g. \"B85905495\" or \"ESB85905495\").",
      +    "type": "string"
      +  }
      +}
    • addedInput schema / properties / supplier / required
      Added value: +[
      +  "name",
      +  "taxId",
      +  "countryCode"
      +]
  2. First observed

TDQS

A4.6/5.0
Behavior5/5

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

Goes well beyond the annotations by disclosing statelessness, determinism, zero storage, and a self-audit step over generated UBL. It also enumerates the response payload (xml, totals {net, tax, gross, currency}, selfAuditValid, fingerprintSha256, qrValidationUrl, qrSvg) and the failure contract (isError=true when lines are empty or inputs invalid), which the readOnly/idempotent hints alone do not convey.

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?

Front-loaded with the core verb and output standards, then the response contract, then routing guidance — a logical order with no filler. It is dense and long-ish, packing many clauses into semicolon-chained sentences, but nearly every clause carries distinct information.

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?

With no output schema, the description carries the burden of describing return values and does so completely, including format-dependent fields and error signaling. For a 10-parameter nested-object generator, it covers inputs, outputs, determinism, and cross-tool workflow adequately.

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 explains format, currency, parties, IBAN, previousHash, and generationTimestamp. The description reinforces the JSON-lines-to-XML relationship and the VeriFactu-only return fields but adds no syntax or format detail beyond what the schema supplies, so the baseline 3 applies.

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 (generate) and concrete resources (EN 16931 Peppol BIS 3.0 UBL 2.1 XML or AEAT VeriFactu <sf:RegistroAlta> block) produced from JSON line items. It is immediately distinguishable from einvoice_validate, which is named as the audit-existing-XML counterpart.

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 says when to use it ('creating new compliant XML invoices from ERP/JSON data'), names the alternative for the opposite case ('use einvoice_validate to audit an existing XML'), and points to a companion tool ('pair with sepa_epc_qr for PDF payment QRs').

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