Skip to main content
Glama

German BNetzA SMARD & § 14a EnWG Grid Fee Preview Oracle

EN 16931 & XRechnung Deterministic E-Invoice Validator

validate_en16931_e_invoice
Read-onlyIdempotent

Deterministically validates European B2B electronic invoices (EN 16931, XRechnung 3.0.2, ZUGFeRD / Factur-X, UBL 2.1, UN/CEFACT CII) using KoSIT-aligned XML/Schematron rules and XXE-safe defusedxml parsing. Use this tool whenever an agent must verify invoice XML syntax, CustomizationID, VAT/currency structure, or obtain cryptographic proof before ERP ingestion. Operates strictly read-only in volatile EU RAM (zero PII retention) and returns a signed Ed25519 W3C Verifiable Credential. Free Pre-GmbH technical preview (0.00 EUR, non-binding format check; not tax or legal advice).

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": {
      "xml_content": "<xml_content>"
    },
    "name": "validate_en16931_e_invoice"
  }
}

Input Schema

NameRequiredDescriptionDefault
xml_contentYesComplete raw EN 16931 / XRechnung / UBL Invoice or UN/CEFACT CrossIndustryInvoice XML document string.
max_accepted_fee_eurNoOptional maximum x402 fee in EUR accepted by the caller (planned post-GmbH list price 0.12 EUR; 0.00 EUR in Pre-GmbH Shadow-Pass). Omit if unpaid.
ap2_intent_mandate_idNoOptional AP2 (Agent Payments Protocol) intent mandate reference ID for audit correlation.

Output Schema

NameRequiredDescriptionDefault
typeYesCredential types (including 'VerifiableCredential' and domain attestation type).
proofYesEd25519 cryptographic signature proof verifiable via /.well-known/did.json.
issuerYesCryptographic issuer DID ('did:web:iotpay.eu').
@contextNoW3C Verifiable Credentials context URIs.
issuanceDateYesISO-8601 UTC issuance timestamp.
credentialSubjectYesDeterministic verification verdict, structured findings, and SHA-256 payload hash.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed6 schema fields changed
    • addedInput schema / properties / ap2_intent_mandate_id / description
      Added value: +"Optional AP2 (Agent Payments Protocol) intent mandate reference ID for audit correlation."
    • changedInput schema / properties / max_accepted_fee_eur / description
      Previous value: -"Maximum fee in EUR your agent is willing to pay per call (list price 0.12 EUR). Omit if not willing to pay."New value: +"Optional maximum x402 fee in EUR accepted by the caller (planned post-GmbH list price 0.12 EUR; 0.00 EUR in Pre-GmbH Shadow-Pass). Omit if unpaid."
    • addedInput schema / properties / max_accepted_fee_eur / minimum
      Added value: +0
    • changedInput schema / properties / xml_content / description
      Previous value: -"Raw EN 16931 / XRechnung / UBL / CII XML string."New value: +"Complete raw EN 16931 / XRechnung / UBL Invoice or UN/CEFACT CrossIndustryInvoice XML document string."
    • addedInput schema / properties / xml_content / minLength
      Added value: +20
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "description": "W3C Verifiable Credential signed with Ed25519 (did:web:iotpay.eu) containing deterministic validation results and SHA-256 payload proof.",
      +  "properties": {
      +    "@context": {
      +      "description": "W3C Verifiable Credentials context URIs.",
      +      "items": {
      +        "type": "string"
      +      },
      +      "type": "array"
      +    },
      +    "credentialSubject": {
      +      "description": "Deterministic verification verdict, structured findings, and SHA-256 payload hash.",
      +      "type": "object"
      +    },
      +    "issuanceDate": {
      +      "description": "ISO-8601 UTC issuance timestamp.",
      +      "type": "string"
      +    },
      +    "issuer": {
      +      "description": "Cryptographic issuer DID ('did:web:iotpay.eu').",
      +      "type": "string"
      +    },
      +    "proof": {
      +      "description": "Ed25519 cryptographic signature proof verifiable via /.well-known/did.json.",
      +      "properties": {
      +        "proofPurpose": {
      +          "type": "string"
      +        },
      +        "signatureHex": {
      +          "type": "string"
      +        },
      +        "type": {
      +          "type": "string"
      +        },
      +        "verificationMethod": {
      +          "type": "string"
      +        }
      +      },
      +      "type": "object"
      +    },
      +    "type": {
      +      "description": "Credential types (including 'VerifiableCredential' and domain attestation type).",
      +      "items": {
      +        "type": "string"
      +      },
      +      "type": "array"
      +    }
      +  },
      +  "required": [
      +    "type",
      +    "issuer",
      +    "issuanceDate",
      +    "credentialSubject",
      +    "proof"
      +  ],
      +  "type": "object"
      +}
  2. Changed1 schema field changed
    • changedInput schema / properties / max_accepted_fee_eur / description
      Previous value: -"Maximum fee in EUR your agent is willing to pay per call (list price 0.03 EUR). Omit if not willing to pay."New value: +"Maximum fee in EUR your agent is willing to pay per call (list price 0.12 EUR). Omit if not willing to pay."
  3. First observed

TDQS

A4.1/5.0
Behavior4/5

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

Annotations already declare readOnlyHint, idempotentHint, destructiveHint=false and openWorldHint=false, so the safety profile is covered. The description adds genuinely non-obvious behavior beyond that: XXE-safe defusedxml parsing, zero PII retention in volatile EU RAM, and a signed Ed25519 W3C Verifiable Credential as the return artifact. The x402 fee and 'Pre-GmbH Shadow-Pass' framing also hint at payment semantics, though the promotional and legal-disclaimer phrasing dilutes rather than clarifies the operational behavior.

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?

A single dense paragraph that front-loads the core action and coverage before moving to usage, then safety, then output. Every sentence is doing work, though the pricing preview and 'not tax or legal advice' disclaimer lean promotional and could be trimmed without losing invocation-relevant information.

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?

With an output schema present, the description needn't enumerate return fields, and it still usefully signals that the response includes a signed Verifiable Credential. Input requirements, safety posture, and the pre-ingestion use case are all covered for a three-parameter tool. The only shortfall is that the payment/fee pathway is described in marketing terms rather than operational ones, leaving the agent to infer how max_accepted_fee_eur actually gates execution.

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 every parameter including xml_content, max_accepted_fee_eur and ap2_intent_mandate_id is already documented in the input schema. The description reinforces that the input is a raw standards-conformant XML document and mentions CustomizationID checking, but adds no syntax, format, or constraint detail the schema does not already carry. Baseline 3 is appropriate.

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 a specific verb ('deterministically validates') and a precisely scoped resource (European B2B e-invoices), then enumerates the standards and formats covered (EN 16931, XRechnung 3.0.2, ZUGFeRD/Factur-X, UBL 2.1, UN/CEFACT CII). An agent can immediately tell this is an XML conformance validator rather than any of the sibling tools, which all operate in unrelated domains.

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?

Explicitly states the trigger condition: 'Use this tool whenever an agent must verify invoice XML syntax, CustomizationID, VAT/currency structure, or obtain cryptographic proof before ERP ingestion.' That is a clear when-to-use signal tied to a workflow stage. It stops short of stating when NOT to use it or naming an alternative path, but the domain is narrow enough that no sibling overlaps.

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.