Skip to main content
Glama

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. 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 and idempotentHint, and the description reinforces this as 'Deterministic calculation & XML processing. Read-only, side-effect free', which is largely redundant with the annotations. It adds real value by disclosing the return payload per mode, since no output schema exists, and by naming the rule set applied. It doesn't say how invalid XML is signalled (thrown error vs. isValid=false) or any size/format limits.

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?

Front-loaded with the capability, then explicit Usage and Returns lines. Every sentence carries information an agent needs; nothing is padding beyond the mildly redundant read-only restatement.

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?

Return shapes for both modes are documented in lieu of an output schema, and mode semantics are clear for a 7-parameter nested-object tool. Still missing failure behavior on malformed XML and whether non-FatturaPA XML is rejected outright, but the definition is sufficient to invoke correctly.

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 coverage is 100%, so the per-parameter baseline is 3. The description earns extra credit by mapping parameters to modes (xmlContent only in audit; items/sender/recipient/document/payment only in builder), a cross-parameter relationship the schema does not express given that required is empty.

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?

Names specific verbs and resources: audits FatturaPA 1.2.2 / Peppol BIS 3.0 invoice XML against SDI XSD schemas and error rules, or generates schema-valid FatturaPA XML. The two modes are stated up front, and the domain specificity (error codes 004xx/003xx, Bollo threshold 77.47€) makes it unmistakable against siblings like codice_fiscale_audit or taric_hs_validator.

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?

Explicit mode routing: mode='audit' with 'xmlContent' to validate, mode='builder' with structured objects to generate. It states which mode to pick and what input each expects. It does not name an alternative tool or state when not to use it, but there is no obvious overlapping sibling, so the absence of exclusions is minor.

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