Skip to main content
Glama
cmendezs

mcp-ksef-pl

Generate Fa2 Invoice

generate_fa2_invoice

Generates a KSeF-compliant FA(2) XML invoice from structured data, ready for submission to KSeF. Seller's NIP is required.

Instructions

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

Returns the FA(2) XML string ready for submission to KSeF. The seller's tax_id must be a Polish NIP (10 digits).

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

A3.5/5.0
Behavior3/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It adds valuable context: output is an XML string (not a submission), it is KSeF-compliant, and the seller's tax_id must be a Polish NIP (10 digits). However, it does not describe potential validation behavior, error conditions, or whether the tool performs any side-effect-free transformation beyond what is implied.

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 description is three concise sentences with no fluff: purpose, output, and the key country-specific constraint. It is front-loaded with the main action and output type, and every sentence earns its place.

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?

Given the highly detailed 100%-coverage schema and the existence of an output schema, the description covers the essentials: what it generates, the return type, and the Polish NIP requirement. It is adequate for an agent to call the tool correctly, though it could be improved by explicitly stating that it only generates and does not submit or validate.

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 the baseline is 3. The description adds one meaningful constraint not in the schema—'The seller's tax_id must be a Polish NIP (10 digits)'—which helps an agent populate the nested seller.tax_id correctly. Beyond that, the description defers to the already-rich inline schema descriptions.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states a specific verb and resource: 'Generate a KSeF-compliant FA(2) XML invoice from structured invoice data.' It also specifies the output format ('FA(2) XML string ready for submission to KSeF'), which distinguishes it from submission, validation, and parsing siblings. However, it does not explicitly name generate_fa3_invoice or generate_peppol_invoice as alternatives, so differentiation relies mostly on the tool name and format.

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 description implies usage context: call this when you have structured invoice data and need an FA(2) XML string for KSeF, and the 'ready for submission' phrase implies the tool does not submit. It does not explicitly state when to prefer generate_fa3_invoice, validate_fa2_invoice, or submit_invoice_to_ksef, and no alternatives are named.

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