Skip to main content
Glama

Polish KSeF FA2 and FA3 XML to PDF API

ksef_xml_to_pdf
Read-onlyIdempotent

Parse Polish KSeF structured electronic invoices using FA2 and FA3 XML schemas into normalized JSON with NIP details, line items, VAT rate summaries, and arithmetic checks, plus a printable A4 PDF document. Deterministic offline rendering, zero AI, nothing stored. Free: 5 calls/day per IP. Paid: Radar API key (from €15/mo at https://radarbg.com/pricing#starter via X-API-Key) or $0.01/call via x402 at https://radarbg.com/x402/ksef-xml-to-pdf.

Example tool call

This call uses example arguments supplied in the tool’s input schema.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?><Faktura xmlns=\"http://crd.gov.pl/wzor/2025/06/25/13775/\"><Naglowek><KodFormularza kodSystemowy=\"FA (3)\" wersjaSchemy=\"1-0E\">FA</KodFormularza><WariantFormularza>3</WariantFormularza><DataWytworzeniaFa>2026-11-04T10:00:00Z</DataWytworzeniaFa></Naglowek><Podmiot1><DaneIdentyfikacyjne><NIP>5260250274</NIP><Nazwa>Żółć Śląska Sp. z o.o.</Nazwa></DaneIdentyfikacyjne><Adres><KodKraju>PL</KodKraju><AdresL1>ul. Żwirki i Wigury 3</AdresL1><AdresL2>40-001 Katowice</AdresL2></Adres><DaneKontaktowe><Email>biuro@zolc.example</Email><Telefon>+48 32 555 01 01</Telefon></DaneKontaktowe></Podmiot1><Podmiot2><DaneIdentyfikacyjne><NIP>7740001454</NIP><Nazwa>Nabywca Łódź Spółka Akcyjna</Nazwa></DaneIdentyfikacyjne><Adres><KodKraju>PL</KodKraju><AdresL1>ul. Piotrkowska 12/4</AdresL1><AdresL2>90-001 Łódź</AdresL2></Adres></Podmiot2><Fa><KodWaluty>PLN</KodWaluty><P_1>2026-11-04</P_1><P_1M>Katowice</P_1M><P_2>FV/2026/11/0042</P_2><P_6>2026-11-03</P_6><P_13_1>2700.00</P_13_1><P_14_1>621.00</P_14_1><P_13_2>100.00</P_13_2><P_14_2>8.00</P_14_2><P_15>3429.00</P_15><Adnotacje><P_16>2</P_16><P_17>2</P_17><P_18>2</P_18><P_18A>1</P_18A><Zwolnienie><P_19N>1</P_19N></Zwolnienie><NoweSrodkiTransportu><P_22N>1</P_22N></NoweSrodkiTransportu><P_23>2</P_23><PMarzy><P_PMarzyN>1</P_PMarzyN></PMarzy></Adnotacje><RodzajFaktury>VAT</RodzajFaktury><FaWiersz><NrWierszaFa>1</NrWierszaFa><P_7>Usługa konsultingowa – wdrożenie systemu księgowego i szkolenie zespołu (pakiet 10 godzin, dojazd wliczony w cenę usługi, dokumentacja powykonawcza)</P_7><P_8A>godz.</P_8A><P_8B>10</P_8B><P_9A>150.00</P_9A><P_11>1500.00</P_11><P_12>23</P_12></FaWiersz><FaWiersz><NrWierszaFa>2</NrWierszaFa><P_7>Licencja roczna oprogramowania</P_7><P_8A>szt.</P_8A><P_8B>1</P_8B><P_9A>1200.00</P_9A><P_11>1200.00</P_11><P_12>23</P_12></FaWiersz><FaWiersz><NrWierszaFa>3</NrWierszaFa><P_7>Materiały szkoleniowe</P_7><P_8A>szt.</P_8A><P_8B>2</P_8B><P_9A>50.00</P_9A><P_11>100.00</P_11><P_12>8</P_12></FaWiersz><Platnosc><Zaplacono>1</Zaplacono><DataZaplaty>2026-11-05</DataZaplaty><TerminPlatnosci><Termin>2026-11-20</Termin></TerminPlatnosci><FormaPlatnosci>6</FormaPlatnosci><RachunekBankowy><NrRB>61109010140000071219812874</NrRB><NazwaBanku>Bank Śląski</NazwaBanku></RachunekBankowy></Platnosc><WarunkiTransakcji><Zamowienia><DataZamowienia>2026-10-28</DataZamowienia><NrZamowienia>ZAM/778</NrZamowienia></Zamowienia></WarunkiTransakcji></Fa><Stopka><Informacje><StopkaFaktury>Kapitał zakładowy 50 000 zł, w pełni opłacony.</StopkaFaktury></Informacje><Rejestry><KRS>0000123456</KRS><REGON>123456789</REGON><BDO>000123456</BDO></Rejestry></Stopka></Faktura>",
      "language": "en",
      "includePdf": true
    },
    "name": "ksef_xml_to_pdf"
  }
}

Input Schema

NameRequiredDescriptionDefault
contentNoRaw Polish KSeF FA2 or FA3 XML string. Provide content or fileBase64.
fileNameNoOptional original filename.
languageNoPDF label language: pl or en (default pl).pl
fileBase64NoBase64-encoded KSeF XML file (max 15 MB).
includePdfNoRender and return a base64-encoded printable A4 PDF.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / properties / content / description
      Previous value: -"Raw Polish KSeF FA(2) or FA(3) XML string. Provide content or fileBase64."New value: +"Raw Polish KSeF FA2 or FA3 XML string. Provide content or fileBase64."
  2. Added

TDQS

A4.4/5.0
Behavior5/5

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

Beyond the readOnly/idempotent annotations, the description discloses that rendering is deterministic and offline, that no AI is involved, and that nothing is stored — all material for a document-handling tool. It also gives concrete operational constraints: 5 free calls/day per IP, paid access via X-API-Key, or $0.01/call through x402, which an agent needs before retrying on failure.

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?

The core capability is front-loaded in the first sentence, with behavior and pricing following. The commercial block (pricing URL, X-API-Key, x402 endpoint) is dense but functional; it could be trimmed slightly but every clause carries actionable information.

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 stateless converter with no output schema, the description fully covers what comes back (structured JSON fields plus a base64 A4 PDF), the supported schema versions, and access/payment conditions. An agent has enough to call it correctly on the first attempt and to interpret the result.

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 schema already explains content, fileBase64, fileName, language, and includePdf. The description adds only a small amount of meaning, chiefly that the input must be raw FA2/FA3 XML and that the PDF output is controlled separately, placing it just above the baseline.

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 names a specific operation and resource set: parsing Polish KSeF FA2/FA3 XML into normalized JSON plus an A4 PDF, and enumerates what the JSON contains (NIP details, line items, VAT summaries, arithmetic checks). It is clearly distinguishable from generic converters such as xml_to_json or ubl_invoice_to_pdf without opening a schema.

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

Usage Guidelines3/5

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

The input domain (KSeF FA2/FA3 invoices) implies when to call this, and the description hints at an either/or input via 'Provide content or fileBase64'. However, it never states when NOT to use it and never routes the agent to a sibling such as ksef_invoice_parser for JSON-only extraction, so selection among near neighbours is left to inference.

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