Skip to main content
Glama
cmendezs

mcp-ksef-pl

Generate Fa3 Invoice

generate_fa3_invoice

Generates KSeF-compliant FA(3) XML invoices from structured invoice data, preparing them for submission to the Polish KSeF API v2.

Instructions

Generate a KSeF-compliant FA(3) XML invoice from structured invoice data.

FA(3) is required for all new invoice submissions via KSeF API v2. Use this tool — not generate_fa2_invoice — before calling submit_invoice_to_ksef.

The seller's tax_id must be a Polish NIP (10 digits). The buyer's tax_id may be a Polish NIP, a EU VAT number (set alt_tax_id), or absent (leave tax_id.identifier empty to emit ).

Returns the FA(3) XML string ready for submit_invoice_to_ksef.

Input Schema

TableJSON 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

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.0.1

TDQS

A4.3/5.0
Behavior4/5

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

No annotations are provided, so the description carries the disclosure burden. It discloses the return value (FA(3) XML string ready for submit_invoice_to_ksef), the F(A)3 compliance requirement, and tax-identifier constraints including the <BrakID> edge case. It does not describe error/validation behavior, but for a pure generation tool this is reasonably transparent.

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 compact and front-loaded with the core action and output format, followed by workflow ordering and key constraints. Every sentence earns its place, with no filler or redundant restatement of schema details.

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?

The tool has a very rich nested schema and an output schema, so the description need not restate field details. It provides the critical workflow context (use before submit_invoice_to_ksef, not generate_fa2_invoice) and important country-specific constraints. The unresolved contradiction about representing an absent buyer tax ID is the main completeness gap.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the baseline is 3, and the description does add useful context such as seller NIP format and buyer tax-id alternatives. However, the instruction to leave tax_id.identifier empty for absent buyer tax IDs contradicts the schema, which requires tax_id and enforces minLength: 1 on identifier. The 'set alt_tax_id' guidance for EU VAT numbers also reads inconsistently with alt_tax_id's schema meaning, so the added value is undercut by misleading edge-case guidance.

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?

States a specific verb and resource: generates a KSeF-compliant FA(3) XML invoice from structured invoice data. It also distinguishes itself from the sibling generate_fa2_invoice, so an agent can identify the correct tool without inspecting 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?

Explicitly says to use this tool rather than generate_fa2_invoice and to call it before submit_invoice_to_ksef. It also explains that FA(3) is required for all new KSeF API v2 submissions, giving clear when/when-not guidance.

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