Skip to main content
Glama

LexGrid EU Tax, KYB & e-Invoicing

e-Invoice XML Auditor & Builder

einvoice_xml_auditor
Read-onlyIdempotent

[Deterministic calculation & XML processing. Read-only, side-effect free]. Audits Italian FatturaPA 1.2.2 and Peppol BIS 3.0 electronic invoice XML against official SDI XSD schemas and error rules (004xx/003xx, rounding, Bollo > 77.47€), or generates schema-valid FatturaPA XML. Usage: mode='audit' with 'xmlContent' to validate XML. mode='builder' with structured objects to generate FatturaPA 1.2.2 XML. Returns: JSON object with { isValid: boolean, standard, sdiErrors, calculatedTotals, breakdownByVatRate } in audit mode, or { standard, xml } in builder mode.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "einvoice_xml_auditor"
  }
}

Input Schema

NameRequiredDescriptionDefault
modeNo'audit' to validate XML or 'builder' to generate XMLaudit
itemsNoInvoice line items (builder mode)
senderNoSupplier legal profile (builder mode)
paymentNoPayment modalities (builder mode)
documentNoInvoice metadata (builder mode)
recipientNoCustomer profile (builder mode)
xmlContentNoRaw XML string of the invoice (required in audit mode)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed31 schema fields changed
    • changedInput schema / properties / document / description
      Previous value: -"Invoice header metadata (in builder mode)"New value: +"Invoice metadata (builder mode)"
    • changedInput schema / properties / document / properties / bolloVirtuale / description
      Previous value: -"Whether virtual stamp duty (Imposta di Bollo 2.00 EUR) applies for tax-exempt amounts > 77.47 EUR"New value: +"Virtual stamp duty (2.00 EUR) for exempt > 77.47 EUR"
    • changedInput schema / properties / document / properties / date / description
      Previous value: -"Invoice date in YYYY-MM-DD format"New value: +"Invoice date (YYYY-MM-DD)"
    • changedInput schema / properties / document / properties / number / description
      Previous value: -"Unique progressive invoice number (e.g. 2026/001)"New value: +"Invoice number (e.g. 2026/001)"
    • changedInput schema / properties / document / properties / type / description
      Previous value: -"Document type code (e.g. TD01 ordinary invoice, TD04 credit note)"New value: +"Document type (e.g. TD01, TD04)"
    • changedInput schema / properties / items / description
      Previous value: -"Invoice line items breakdown (in builder mode)"New value: +"Invoice line items (builder mode)"
    • changedInput schema / properties / items / items / properties / description / description
      Previous value: -"Line item service or product description"New value: +"Line item description"
    • changedInput schema / properties / items / items / properties / natura / description
      Previous value: -"VAT exemption nature code if vatRate is 0 (e.g. N2.2, N3.5, N4)"New value: +"VAT exemption code if vatRate 0 (e.g. N2.2, N4)"
    • changedInput schema / properties / items / items / properties / quantity / description
      Previous value: -"Quantity of items billed"New value: +"Quantity billed"
    • changedInput schema / properties / payment / description
      Previous value: -"Optional payment modalities (in builder mode)"New value: +"Payment modalities (builder mode)"
    • changedInput schema / properties / payment / properties / bic / description
      Previous value: -"SWIFT/BIC bank routing identifier"New value: +"SWIFT/BIC code"
    • changedInput schema / properties / payment / properties / dueDate / description
      Previous value: -"Payment due date in YYYY-MM-DD format"New value: +"Due date (YYYY-MM-DD)"
    • changedInput schema / properties / payment / properties / iban / description
      Previous value: -"Beneficiary IBAN for bank transfer"New value: +"Beneficiary IBAN"
    • changedInput schema / properties / payment / properties / method / description
      Previous value: -"Payment method code (e.g. MP05 for SEPA wire transfer, MP08 for card, MP01 for cash)"New value: +"Payment method code (e.g. MP05, MP08)"
    • changedInput schema / properties / recipient / description
      Previous value: -"Customer / buyer profile (in builder mode)"New value: +"Customer profile (builder mode)"
    • changedInput schema / properties / recipient / properties / cap / description
      Previous value: -"5-digit postal code (e.g. 20121)"New value: +"5-digit postal code"
    • changedInput schema / properties / recipient / properties / city / description
      Previous value: -"Municipality name (e.g. Milano)"New value: +"Municipality name"
    • changedInput schema / properties / recipient / properties / codiceDestinatario / description
      Previous value: -"7-character SDI recipient code or 6-character IPA code for PA or 0000000 for consumers"New value: +"7-char SDI recipient code or 6-char IPA or 0000000"
    • changedInput schema / properties / recipient / properties / companyName / description
      Previous value: -"Client or public administration name"New value: +"Client or PA name"
    • changedInput schema / properties / recipient / properties / country / description
      Previous value: -"2-letter ISO country code (e.g. IT)"New value: +"2-letter ISO country (e.g. IT)"
    • changedInput schema / properties / recipient / properties / pecDestinatario / description
      Previous value: -"Certified PEC email address if codiceDestinatario is 0000000"New value: +"Certified PEC email address"
    • changedInput schema / properties / recipient / properties / province / description
      Previous value: -"2-letter province code (e.g. MI)"New value: +"2-letter province code"
    • changedInput schema / properties / sender / description
      Previous value: -"Supplier / seller legal profile (in builder mode)"New value: +"Supplier legal profile (builder mode)"
    • changedInput schema / properties / sender / properties / cap / description
      Previous value: -"5-digit postal code (e.g. 00100)"New value: +"5-digit postal code"
    • changedInput schema / properties / sender / properties / city / description
      Previous value: -"Municipality name (e.g. Roma)"New value: +"Municipality name"
    • changedInput schema / properties / sender / properties / companyName / description
      Previous value: -"Sender company or legal entity name"New value: +"Sender company name"
    • changedInput schema / properties / sender / properties / country / description
      Previous value: -"2-letter ISO country code (e.g. IT)"New value: +"2-letter ISO country (e.g. IT)"
    • changedInput schema / properties / sender / properties / fiscalCode / description
      Previous value: -"Codice Fiscale (16 chars or 11 digits)"New value: +"Codice Fiscale"
    • changedInput schema / properties / sender / properties / province / description
      Previous value: -"2-letter Italian province code (e.g. RM)"New value: +"2-letter Italian province code"
    • changedInput schema / properties / sender / properties / regimeFiscale / description
      Previous value: -"Tax regime code (e.g. RF01 for ordinary, RF19 for flat-rate/forfettario)"New value: +"Tax regime code (e.g. RF01, RF19)"
    • changedInput schema / properties / sender / properties / vatNumber / description
      Previous value: -"Sender VAT number without country prefix (e.g. 01234567890)"New value: +"Sender VAT number without country prefix"
  2. Changed19 schema fields changed
    • changedInput schema / properties / document / description
      Previous value: -"Document details (number, date, currency) (in builder mode)"New value: +"Invoice header metadata (in builder mode)"
    • addedInput schema / properties / document / properties
      Added value: +{
      +  "bolloVirtuale": {
      +    "description": "Whether virtual stamp duty (Imposta di Bollo 2.00 EUR) applies for tax-exempt amounts > 77.47 EUR",
      +    "type": "boolean"
      +  },
      +  "currency": {
      +    "description": "3-letter currency code (default: EUR)",
      +    "type": "string"
      +  },
      +  "date": {
      +    "description": "Invoice date in YYYY-MM-DD format",
      +    "type": "string"
      +  },
      +  "number": {
      +    "description": "Unique progressive invoice number (e.g. 2026/001)",
      +    "type": "string"
      +  },
      +  "type": {
      +    "description": "Document type code (e.g. TD01 ordinary invoice, TD04 credit note)",
      +    "type": "string"
      +  }
      +}
    • addedInput schema / properties / document / required
      Added value: +[
      +  "date",
      +  "number"
      +]
    • addedInput schema / properties / document / type
      Added value: +"object"
    • changedInput schema / properties / items / description
      Previous value: -"Items array with unitPrice, quantity, vatRate, natura (in builder mode)"New value: +"Invoice line items breakdown (in builder mode)"
    • addedInput schema / properties / items / items / properties
      Added value: +{
      +  "description": {
      +    "description": "Line item service or product description",
      +    "type": "string"
      +  },
      +  "natura": {
      +    "description": "VAT exemption nature code if vatRate is 0 (e.g. N2.2, N3.5, N4)",
      +    "type": "string"
      +  },
      +  "quantity": {
      +    "description": "Quantity of items billed",
      +    "type": "number"
      +  },
      +  "unitPrice": {
      +    "description": "Unit price in EUR excluding VAT",
      +    "type": "number"
      +  },
      +  "vatRate": {
      +    "description": "VAT rate percentage (e.g. 22, 10, 5, 0)",
      +    "type": "number"
      +  }
      +}
    • addedInput schema / properties / items / items / required
      Added value: +[
      +  "description",
      +  "quantity",
      +  "unitPrice",
      +  "vatRate"
      +]
    • addedInput schema / properties / items / items / type
      Added value: +"object"
    • changedInput schema / properties / payment / description
      Previous value: -"Optional payment details with IBAN and BIC (in builder mode)"New value: +"Optional payment modalities (in builder mode)"
    • addedInput schema / properties / payment / properties
      Added value: +{
      +  "bic": {
      +    "description": "SWIFT/BIC bank routing identifier",
      +    "type": "string"
      +  },
      +  "dueDate": {
      +    "description": "Payment due date in YYYY-MM-DD format",
      +    "type": "string"
      +  },
      +  "iban": {
      +    "description": "Beneficiary IBAN for bank transfer",
      +    "type": "string"
      +  },
      +  "method": {
      +    "description": "Payment method code (e.g. MP05 for SEPA wire transfer, MP08 for card, MP01 for cash)",
      +    "type": "string"
      +  }
      +}
    • addedInput schema / properties / payment / type
      Added value: +"object"
    • changedInput schema / properties / recipient / description
      Previous value: -"Recipient object (in builder mode)"New value: +"Customer / buyer profile (in builder mode)"
    • addedInput schema / properties / recipient / properties
      Added value: +{
      +  "address": {
      +    "description": "Billing street address",
      +    "type": "string"
      +  },
      +  "cap": {
      +    "description": "5-digit postal code (e.g. 20121)",
      +    "type": "string"
      +  },
      +  "city": {
      +    "description": "Municipality name (e.g. Milano)",
      +    "type": "string"
      +  },
      +  "codiceDestinatario": {
      +    "description": "7-character SDI recipient code or 6-character IPA code for PA or 0000000 for consumers",
      +    "type": "string"
      +  },
      +  "companyName": {
      +    "description": "Client or public administration name",
      +    "type": "string"
      +  },
      +  "country": {
      +    "description": "2-letter ISO country code (e.g. IT)",
      +    "type": "string"
      +  },
      +  "fiscalCode": {
      +    "description": "Recipient Codice Fiscale",
      +    "type": "string"
      +  },
      +  "pecDestinatario": {
      +    "description": "Certified PEC email address if codiceDestinatario is 0000000",
      +    "type": "string"
      +  },
      +  "province": {
      +    "description": "2-letter province code (e.g. MI)",
      +    "type": "string"
      +  },
      +  "vatNumber": {
      +    "description": "Recipient VAT number",
      +    "type": "string"
      +  }
      +}
    • addedInput schema / properties / recipient / required
      Added value: +[
      +  "country",
      +  "companyName",
      +  "address",
      +  "cap",
      +  "city"
      +]
    • addedInput schema / properties / recipient / type
      Added value: +"object"
    • changedInput schema / properties / sender / description
      Previous value: -"Sender object (in builder mode)"New value: +"Supplier / seller legal profile (in builder mode)"
    • addedInput schema / properties / sender / properties
      Added value: +{
      +  "address": {
      +    "description": "Registered office street address",
      +    "type": "string"
      +  },
      +  "cap": {
      +    "description": "5-digit postal code (e.g. 00100)",
      +    "type": "string"
      +  },
      +  "city": {
      +    "description": "Municipality name (e.g. Roma)",
      +    "type": "string"
      +  },
      +  "companyName": {
      +    "description": "Sender company or legal entity name",
      +    "type": "string"
      +  },
      +  "country": {
      +    "description": "2-letter ISO country code (e.g. IT)",
      +    "type": "string"
      +  },
      +  "fiscalCode": {
      +    "description": "Codice Fiscale (16 chars or 11 digits)",
      +    "type": "string"
      +  },
      +  "province": {
      +    "description": "2-letter Italian province code (e.g. RM)",
      +    "type": "string"
      +  },
      +  "regimeFiscale": {
      +    "description": "Tax regime code (e.g. RF01 for ordinary, RF19 for flat-rate/forfettario)",
      +    "type": "string"
      +  },
      +  "vatNumber": {
      +    "description": "Sender VAT number without country prefix (e.g. 01234567890)",
      +    "type": "string"
      +  }
      +}
    • addedInput schema / properties / sender / required
      Added value: +[
      +  "country",
      +  "vatNumber",
      +  "companyName",
      +  "address",
      +  "cap",
      +  "city"
      +]
    • addedInput schema / properties / sender / type
      Added value: +"object"
  3. First observed

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already declare readOnlyHint, idempotentHint, and destructiveHint=false, so safety is covered. The description adds valuable behavior beyond annotations: deterministic processing, official SDI XSD validation, error rules such as 004xx/003xx, rounding, and the Bollo > 77.47€ threshold, plus return shapes for both modes.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is front-loaded with purpose, then usage per mode, then return shape. Every sentence contributes operational information; even the bracketed read-only note is brief and consistent with the annotations.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a complex, nested-object tool with no output schema, the description supplies the key mode behavior and return structures. Minor gaps remain around detailed builder validation behavior and any limits of the audit checks, but the rich schema and annotations cover most remaining needs.

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

Parameters4/5

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

Schema description coverage is 100%, so the baseline is 3. The description still adds meaning by clarifying that xmlContent is used in audit mode and structured objects in builder mode, which is conditional usage information not fully expressed by the schema alone.

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?

The description states a specific verb and resource: it audits Italian FatturaPA 1.2.2 and Peppol BIS 3.0 invoice XML, and can generate FatturaPA XML. It clearly distinguishes its two modes, audit and builder, so an agent can tell what the tool does without opening the schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It explicitly maps mode='audit' to xmlContent validation and mode='builder' to structured-object generation, giving clear context for invocation. It does not name exclusions or alternative tools, so it falls short of full when/when-not guidance.

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