Skip to main content
Glama

Send invoice to KSeF

send_invoice_to_ksef
DestructiveIdempotent

Sends the issued invoice of a Polish company summarised by prepare_send_invoice_to_ksef to KSeF (the Polish national e-invoicing system) once the user has confirmed it, using its confirmation token, and returns its KSeF status. Sending can't be undone; on a KSeF test environment it is not legally binding. Refused, with the token used up, when the token expired or doesn't match, or the invoice, the KSeF environment or the mode changed after the preparation. KSeF processes the invoice in the background; refresh_ksef_status reads the final status. A repeated call with the same token returns the same answer without sending again.

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": {
      "company_id": "<company_id>",
      "invoice_id": "<invoice_id>",
      "confirmation_token": "<confirmation_token>"
    },
    "name": "send_invoice_to_ksef"
  }
}

Input Schema

NameRequiredDescriptionDefault
company_idYesThe id of the company, from list_companies.
invoice_idYesThe id of the issued invoice, from list_invoices.
confirmation_tokenYesThe confirmation_token of the answer of prepare_send_invoice_to_ksef for this invoice.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.8/5.0
Behavior5/5

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

Beyond the annotations it discloses irreversibility, that sending is not legally binding on a test environment, token consumption on refusal, background processing with a separate status tool, and idempotent replay semantics for a repeated token. These are exactly the behaviors an agent needs and are not derivable from readOnlyHint/destructiveHint/idempotentHint alone.

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?

Front-loads the action and its prerequisite in the first sentence, then appends failure modes and idempotency without redundancy. Dense but every clause carries distinct information; only the length of the refusal sentence slightly burdens scanning.

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 destructive, open-world, token-gated write with no output schema, the description covers prerequisites, refusal conditions, irreversibility, return value, and the follow-up tool for async completion. Nothing an agent needs in order to call it correctly and interpret the result is missing.

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 coverage is 100%, so the baseline is 3; the description goes further by explaining that the confirmation token is bound to the preparation state and becomes unusable if the token expires or the invoice, environment, or mode changed. That adds real meaning about token validity beyond the schema text, though company_id and invoice_id are left entirely to the schema.

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 (sends the issued invoice to KSeF) and ties it directly to the prepare_send_invoice_to_ksef output it consumes, so an agent can distinguish it from the sibling that prepares the send. It also says what the call returns (KSeF status), which separates it from sibling tools operating on invoices locally.

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 conditions use on prior preparation and user confirmation, and names refresh_ksef_status as the tool to poll for the final status because KSeF processes asynchronously. It also states the failure conditions (expired or mismatched token, changed invoice/environment/mode), which tells the agent when this call will be refused.

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