Skip to main content
Glama

Render invoice as HTML

invoice_to_html
Read-onlyIdempotent

Render one European e-invoice as a self-contained, printable HTML page: header, seller and buyer, line items, VAT breakdown, totals and payment details in one layout regardless of the source syntax, labels in lang. Use it to show an invoice to a person or to print it to PDF from a browser; it does not validate (use validate_invoice) and is not an accounting export (use invoice_to_csv or invoice_to_datev). Input: XML (UBL, CII, XRechnung, Peppol BIS 3, UAE PINT AE, FatturaPA, KSeF FA(2)/FA(3)) or a ZUGFeRD/Factur-X hybrid PDF up to 25 MB; plain or scanned PDFs without embedded XML are rejected (no OCR). Returns the HTML document as one text string with inline CSS and no external assets; an unreadable file returns a tool error with the reason. Costs one invoice credit per call; without an API key the anonymous quota is 20 invoices per day per IP. Nothing is stored.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
ksefNoPoland only: the KSeF number the National e-Invoice System gave this invoice — 35 characters, NNNNNNNNNN-RRRRMMDD-FFFFFFFFFFFF-FF — or the collective identifier covering it (NNNNNNNNNN-IZRRRRMM-FFFFFFFFFFFF-FF). KSeF assigns it on acceptance, so it is never inside the FA(2)/FA(3) XML: it arrives beside the invoice in the KSeF API response, the UPO or the QR code on a visualisation. Pass it and it is checked against the invoice and returned on payment.ksef_number, the reference a Polish buyer must quote in the bank transfer title from 2027-01-01. Leave empty for invoices from any other country.
langNoLanguage of the fix hints in the validation report and of the labels in HTML output. Default en.en
pathNoAbsolute path of the invoice file on the machine running the server, used instead of file_base64. Only honoured over stdio (`python -m invoicein.mcp_server`); the hosted server at invoicein-api.peculiar.systems ignores it and answers with an error asking for file_base64.
file_base64NoInvoice file content, base64-encoded (standard alphabet). Accepted content: XML in UBL 2.1, CII D16B, XRechnung, Peppol BIS Billing 3, FatturaPA 1.2 or KSeF FA(2)/FA(3) syntax, or a ZUGFeRD 1.0/2.x or Factur-X hybrid PDF (the embedded XML is used). Max 25 MB decoded. Required unless `path` is given.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / properties / ksef
      Added value: +{
      +  "default": "",
      +  "description": "Poland only: the KSeF number the National e-Invoice System gave this invoice — 35 characters, NNNNNNNNNN-RRRRMMDD-FFFFFFFFFFFF-FF — or the collective identifier covering it (NNNNNNNNNN-IZRRRRMM-FFFFFFFFFFFF-FF). KSeF assigns it on acceptance, so it is never inside the FA(2)/FA(3) XML: it arrives beside the invoice in the KSeF API response, the UPO or the QR code on a visualisation. Pass it and it is checked against the invoice and returned on payment.ksef_number, the reference a Polish buyer must quote in the bank transfer title from 2027-01-01. Leave empty for invoices from any other country.",
      +  "title": "Ksef",
      +  "type": "string"
      +}
  2. Changed11 schema fields changed
    • removedInput schema / properties / file_base64 / anyOf
      Removed value: -[
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • changedInput schema / properties / file_base64 / default
      Previous value: -nullNew value: +""
    • changedInput schema / properties / file_base64 / description
      Previous value: -"The invoice file, base64-encoded: XML (UBL, CII, XRechnung, Peppol, FatturaPA, KSeF FA(3)) or a ZUGFeRD/Factur-X hybrid PDF. Up to 25 MB decoded."New value: +"Invoice file content, base64-encoded (standard alphabet). Accepted content: XML in UBL 2.1, CII D16B, XRechnung, Peppol BIS Billing 3, FatturaPA 1.2 or KSeF FA(2)/FA(3) syntax, or a ZUGFeRD 1.0/2.x or Factur-X hybrid PDF (the embedded XML is used). Max 25 MB decoded. Required unless `path` is given."
    • addedInput schema / properties / file_base64 / type
      Added value: +"string"
    • changedInput schema / properties / lang / description
      Previous value: -"Language of the fix hints and rendering labels: en, de, pl, it or fr."New value: +"Language of the fix hints in the validation report and of the labels in HTML output. Default en."
    • addedInput schema / properties / lang / enum
      Added value: +[
      +  "en",
      +  "de",
      +  "pl",
      +  "it",
      +  "fr"
      +]
    • removedInput schema / properties / lang / pattern
      Removed value: -"^(en|de|pl|it|fr)$"
    • removedInput schema / properties / path / anyOf
      Removed value: -[
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • changedInput schema / properties / path / default
      Previous value: -nullNew value: +""
    • changedInput schema / properties / path / description
      Previous value: -"Local file path instead of file_base64; only honoured when the server runs over stdio on the same machine."New value: +"Absolute path of the invoice file on the machine running the server, used instead of file_base64. Only honoured over stdio (`python -m invoicein.mcp_server`); the hosted server at invoicein-api.peculiar.systems ignores it and answers with an error asking for file_base64."
    • addedInput schema / properties / path / type
      Added value: +"string"
  3. First observed

TDQS

A4.7/5.0
Behavior5/5

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

Annotations already declare readOnlyHint=true and idempotentHint=true, but the description adds significant behavioral detail beyond that: the output is a self-contained HTML string with inline CSS and no external assets, an unreadable file returns a tool error with the reason, each call costs one invoice credit, anonymous quota is 20 invoices per day per IP, and nothing is stored. These operational traits are not inferable from the annotations and materially affect how an agent uses the tool. No contradiction with annotations.

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 long but every sentence earns its place. It front-loads the purpose, then moves to usage guidance, input constraints, output format, error behavior, cost, quota, and storage. The structure is logical and scannable: purpose → alternatives → input → output → operational notes. No filler or redundant phrasing; the density is justified by the tool's complexity.

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?

For a tool with many input formats, output requirements, and operational constraints, the description covers all essential aspects: input types and size limits, rejection criteria, output format (HTML string, inline CSS, no external assets), error behavior, cost, quota, and data retention. Since an output schema exists, the return value structure is already documented. The description also explicitly points to sibling tools for validation and export, making it complete for an agent to decide and invoke correctly.

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?

The input schema covers 100% of the parameters with detailed descriptions (e.g., the KSeF format, the lang enum, path vs. file_base64 usage). The tool description adds little beyond the schema: it mentions 'labels in lang' and references the input formats, but these are already captured in the parameter descriptions. With full schema coverage, the baseline of 3 is appropriate; the description does not meaningfully enhance parameter understanding beyond what the schema already provides.

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 opens with a precise verb–resource pair ('Render one European e-invoice as a self-contained, printable HTML page') and enumerates exactly what the HTML contains (header, seller/buyer, line items, VAT, totals, payment details). It also names the siblings it is not: 'it does not validate (use validate_invoice) and is not an accounting export (use invoice_to_csv or invoice_to_datev)', so an agent can immediately tell it apart from the other invoice tools without inspecting their schemas.

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?

The description explicitly states when to use this tool ('to show an invoice to a person or to print it to PDF from a browser'), when not to use it (validation and accounting export), and gives concrete exclusions (plain or scanned PDFs without embedded XML are rejected, no OCR). It also provides input format limits (25 MB, specific XML syntaxes, hybrid PDFs) and cost/quota details, so the agent has full context for choosing this tool over alternatives.

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.