Skip to main content
Glama
gacabartosz
by gacabartosz

ksef_batch_close

Destructive

Finalize a KSeF batch session by providing its reference number after all invoice parts have been sent.

Instructions

Zamknij sesję batch po wysłaniu wszystkich części. Wymaga aktywnej sesji KSeF.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
referenceNumberYesNumer referencyjny sesji batch

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.8/5.0
Behavior3/5

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

The destructiveHint annotation already signals that this operation is destructively finalizing. The description adds the useful context that an active KSeF session is required and that it should happen after all parts are sent. However, it does not explain consequences such as no further parts being accepted after closing, so it only partially supplements the annotation.

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?

Two short, purposeful sentences with no filler: action, timing, and prerequisite. The essential information is front-loaded and every word contributes to the agent's ability to invoke the tool correctly.

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?

For a single-parameter destructive operation with annotations and no output schema, the description is fairly complete: it names the action, the required reference parameter is covered by the schema, and it specifies both the timing and prerequisite. The main omission is an explicit statement of irreversibility or post-close behavior, but the destructiveHint partially covers that.

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%, and the schema already describes referenceNumber as 'Numer referencyjny sesji batch'. The description adds no additional detail about the parameter's format, origin, or how to obtain it, but the schema carries the parameter-meaning burden adequately.

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?

Description states a specific action ('Zamknij' — close) on a specific resource ('sesję batch') and gives the sequencing condition 'po wysłaniu wszystkich części'. It is distinguishable from sibling operations like ksef_batch_open, ksef_batch_send_part, and ksef_batch_status, though it does not explicitly name an alternative tool.

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

Usage Guidelines4/5

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

Provides clear usage context: the tool should be used after all batch parts have been sent, and it requires an active KSeF session. It does not explicitly list alternatives or exclusion cases, but the sequencing and prerequisite give an agent enough guidance for when to invoke it.

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