Skip to main content
Glama
mcp-ksef-pl

mcp-ksef-pl

Generate Peppol Invoice

generate_peppol_invoice

Generate Peppol BIS Billing 3.0 / EN 16931 UBL 2.1 XML invoices for cross-border B2B invoicing over the Peppol network.

Instructions

Generate a Peppol BIS Billing 3.0 / EN 16931 UBL 2.1 XML invoice.

Use this for cross-border B2B invoicing via the Peppol network. For domestic Polish invoicing, use generate_fa2_invoice instead.

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": {
      "invoice": "<invoice>"
    },
    "name": "generate_peppol_invoice"
  }
}

Input Schema

NameRequiredDescriptionDefault
invoiceYesCountry-agnostic invoice document envelope. Country adapters read/write this model via BaseDocumentGenerator.generate() and BaseDocumentParser.to_invoice_document(). document_type: Country-specific code (IT: TD01–TD28, UBL: 380/381/384, DE: RE/GU…). transmission_format: Platform routing hint (IT: FPA12/FPR12, FR: B2B/B2BInt/B2C).

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed8 schema fields changedv0.10.2
    • changedInput schema / properties / invoice / properties / lines / items / properties / quantity / anyOf
      Previous value: -[
      -  {
      -    "type": "number"
      -  },
      -  {
      -    "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]New value: +[
      +  {
      +    "type": "number"
      +  },
      +  {
      +    "type": "string"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • changedInput schema / properties / invoice / properties / lines / items / properties / total_price / anyOf
      Previous value: -[
      -  {
      -    "type": "number"
      -  },
      -  {
      -    "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
      -    "type": "string"
      -  }
      -]New value: +[
      +  {
      +    "type": "number"
      +  },
      +  {
      +    "type": "string"
      +  }
      +]
    • changedInput schema / properties / invoice / properties / lines / items / properties / unit_price / anyOf
      Previous value: -[
      -  {
      -    "type": "number"
      -  },
      -  {
      -    "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
      -    "type": "string"
      -  }
      -]New value: +[
      +  {
      +    "type": "number"
      +  },
      +  {
      +    "type": "string"
      +  }
      +]
    • changedInput schema / properties / invoice / properties / lines / items / properties / vat_rate / anyOf
      Previous value: -[
      -  {
      -    "maximum": 100,
      -    "minimum": 0,
      -    "type": "number"
      -  },
      -  {
      -    "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
      -    "type": "string"
      -  }
      -]New value: +[
      +  {
      +    "maximum": 100,
      +    "minimum": 0,
      +    "type": "number"
      +  },
      +  {
      +    "type": "string"
      +  }
      +]
    • changedInput schema / properties / invoice / properties / payment / anyOf
      Previous value: -[
      -  {
      -    "description": "Payment terms and method.\n\nMaps to IT DatiPagamento, UBL PaymentMeans, ZUGFeRD ram:SpecifiedTradePaymentTerms.\n\n[AMBIGUITY: IT uses structured codes (TP01/02/03 + MP01-23). UBL and ZUGFeRD use\n free-text terms + UNCL4461 payment means codes. The base model uses free-form\n strings to remain format-neutral; country validators enforce their own code sets.]\nOption A: Store raw country codes → simpler, no translation layer needed.\nOption B: Use enums mapped per country → more type-safe but requires maintenance.\nChosen: Option A (raw strings). Rationale: code sets vary significantly (IT has 23\npayment methods, UBL UNCL4461 has 70+).",
      -    "properties": {
      -      "amount": {
      -        "anyOf": [
      -          {
      -            "type": "number"
      -          },
      -          {
      -            "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
      -            "type": "string"
      -          }
      -        ],
      -        "description": "Payment amount"
      -      },
      -      "bank_name": {
      -        "anyOf": [
      -          {
      -            "type": "string"
      -          },
      -          {
      -            "type": "null"
      -          }
      -        ],
      -        "default": null,
      -        "description": "Financial institution name"
      -      },
      -      "bic": {
      -        "anyOf": [
      -          {
      -            "type": "string"
      -          },
      -          {
      -            "type": "null"
      -          }
      -        ],
      -        "default": null,
      -        "description": "BIC/SWIFT code for international transfers"
      -      },
      -      "due_date": {
      -        "anyOf": [
      -          {
      -            "type": "string"
      -          },
      -          {
      -            "type": "null"
      -          }
      -        ],
      -        "default": null,
      -        "description": "Payment due date (YYYY-MM-DD)"
      -      },
      -      "iban": {
      -        "anyOf": [
      -          {
      -            "type": "string"
      -          },
      -          {
      -            "type": "null"
      -          }
      -        ],
      -        "default": null,
      -        "description": "IBAN for bank transfers (validated by xml_utils.validate_iban)"
      -      },
      -      "payment_method_code": {
      -        "description": "Country-specific payment method code (IT: MP01-23, UBL: UNCL4461)",
      -        "type": "string"
      -      },
      -      "payment_terms_code": {
      -        "anyOf": [
      -          {
      -            "type": "string"
      -          },
      -          {
      -            "type": "null"
      -          }
      -        ],
      -        "default": null,
      -        "description": "Country-specific payment terms code (IT: TP01/02/03, ES: contado/plazo)"
      -      }
      -    },
      -    "required": [
      -      "payment_method_code",
      -      "amount"
      -    ],
      -    "type": "object"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]New value: +[
      +  {
      +    "description": "Payment terms and method.\n\nMaps to IT DatiPagamento, UBL PaymentMeans, ZUGFeRD ram:SpecifiedTradePaymentTerms.\n\n[AMBIGUITY: IT uses structured codes (TP01/02/03 + MP01-23). UBL and ZUGFeRD use\n free-text terms + UNCL4461 payment means codes. The base model uses free-form\n strings to remain format-neutral; country validators enforce their own code sets.]\nOption A: Store raw country codes → simpler, no translation layer needed.\nOption B: Use enums mapped per country → more type-safe but requires maintenance.\nChosen: Option A (raw strings). Rationale: code sets vary significantly (IT has 23\npayment methods, UBL UNCL4461 has 70+).",
      +    "properties": {
      +      "amount": {
      +        "anyOf": [
      +          {
      +            "type": "number"
      +          },
      +          {
      +            "type": "string"
      +          }
      +        ],
      +        "description": "Payment amount"
      +      },
      +      "bank_name": {
      +        "anyOf": [
      +          {
      +            "type": "string"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ],
      +        "default": null,
      +        "description": "Financial institution name"
      +      },
      +      "bic": {
      +        "anyOf": [
      +          {
      +            "type": "string"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ],
      +        "default": null,
      +        "description": "BIC/SWIFT code for international transfers"
      +      },
      +      "due_date": {
      +        "anyOf": [
      +          {
      +            "type": "string"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ],
      +        "default": null,
      +        "description": "Payment due date (YYYY-MM-DD)"
      +      },
      +      "iban": {
      +        "anyOf": [
      +          {
      +            "type": "string"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ],
      +        "default": null,
      +        "description": "IBAN for bank transfers (validated by xml_utils.validate_iban)"
      +      },
      +      "payment_method_code": {
      +        "description": "Country-specific payment method code (IT: MP01-23, UBL: UNCL4461)",
      +        "type": "string"
      +      },
      +      "payment_terms_code": {
      +        "anyOf": [
      +          {
      +            "type": "string"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ],
      +        "default": null,
      +        "description": "Country-specific payment terms code (IT: TP01/02/03, ES: contado/plazo)"
      +      }
      +    },
      +    "required": [
      +      "payment_method_code",
      +      "amount"
      +    ],
      +    "type": "object"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • changedInput schema / properties / invoice / properties / vat_summary / items / properties / taxable_base / anyOf
      Previous value: -[
      -  {
      -    "type": "number"
      -  },
      -  {
      -    "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
      -    "type": "string"
      -  }
      -]New value: +[
      +  {
      +    "type": "number"
      +  },
      +  {
      +    "type": "string"
      +  }
      +]
    • changedInput schema / properties / invoice / properties / vat_summary / items / properties / vat_amount / anyOf
      Previous value: -[
      -  {
      -    "type": "number"
      -  },
      -  {
      -    "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
      -    "type": "string"
      -  }
      -]New value: +[
      +  {
      +    "type": "number"
      +  },
      +  {
      +    "type": "string"
      +  }
      +]
    • changedInput schema / properties / invoice / properties / vat_summary / items / properties / vat_rate / anyOf
      Previous value: -[
      -  {
      -    "maximum": 100,
      -    "minimum": 0,
      -    "type": "number"
      -  },
      -  {
      -    "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
      -    "type": "string"
      -  }
      -]New value: +[
      +  {
      +    "maximum": 100,
      +    "minimum": 0,
      +    "type": "number"
      +  },
      +  {
      +    "type": "string"
      +  }
      +]
  2. First observedv0.0.1

TDQS

A4.2/5.0
Behavior3/5

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

With no annotations, the description carries the full burden. It makes clear the output is an XML document and not a transmitted message, which is useful, but it says nothing about side effects, whether the invoice is validated against Peppol rules, permissions, or whether generation is file-local versus network-submitting. The 'via the Peppol network' phrase even leaves a small ambiguity about whether delivery happens here.

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?

Three short sentences, each doing distinct work: what it produces, when to use it, when to use the sibling instead. No restatement of the title or filler.

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?

An output schema exists, so return values need no prose, and the deep nested input model is documented in the schema itself. What remains uncovered is whether generation includes validation or transmission, which for a standards-conformance tool would be useful before calling it.

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?

There is only one top-level parameter and schema description coverage is 100%, with the nested seller/buyer/tax_id/lines objects extensively documented in-schema (including country-specific mappings). The description adds no additional parameter guidance beyond the schema, so the baseline of 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?

Names a specific verb (generate) plus the exact artifact and standards: 'Peppol BIS Billing 3.0 / EN 16931 UBL 2.1 XML invoice'. It also distinguishes itself from the sibling it could be confused with, so an agent can separate it from generate_fa2_invoice without opening either schema.

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?

Gives an explicit positive condition ('cross-border B2B invoicing via the Peppol network') and an explicit exclusion with a redirect ('For domestic Polish invoicing, use generate_fa2_invoice instead'). The routing decision is fully resolved inside the definition.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.