Skip to main content
Glama
gacabartosz
by gacabartosz

ksef_draft_update

Update draft invoice fields in KSeF: modify seller/buyer data, number, dates, or items; amounts recalculate automatically. Not for locked or sent invoices.

Instructions

Zaktualizuj draft faktury (patch). Można zmienić dowolne pola: dane sprzedawcy/nabywcy, numer, daty, pozycje. Przelicza kwoty automatycznie. Nie można edytować locked/sent.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesID draftu (UUID)
itemsNoPozycje faktury (zastępuje istniejące)
buyerNipNoNIP nabywcy
currencyNoWaluta
sellDateNoData sprzedaży (YYYY-MM-DD)
buyerNameNoNazwa nabywcy
issueDateNoData wystawienia (YYYY-MM-DD)
sellerNipNoNIP sprzedawcy
sellerNameNoNazwa sprzedawcy
buyerAddressNoAdres nabywcy
invoiceNumberNoNumer faktury
sellerAddressNoAdres sprzedawcy

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.2/5.0
Behavior4/5

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

With no annotations provided, the description carries the full burden and it discloses three key behaviors beyond the name: patch semantics, automatic amount recalculation ('Przelicza kwoty automatycznie'), and the locked/sent immutability constraint. It does not state what happens if a locked/sent edit is attempted (error vs silent ignore) nor whether omitted fields keep their values, which is the remaining gap.

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?

Three sentences with no filler: first states action and patch semantics, second lists editable scope plus the recalculation side-effect, third flags the constraint. The verb is front-loaded 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?

For a flat 12-parameter patch tool with one required field, no output schema, and no annotations, the description covers the decisions an agent needs to call it correctly: partial update, editable fields, auto-recalc, and the immutable locked/sent states. Minor omissions – response format and the concrete error behavior for locked/sent drafts – do not block correct invocation.

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?

The schema documents all 12 parameters at 100% coverage, so the baseline is 3. The description adds only aggregate context – which field groups are editable and the recalculation side-effect on items – which is useful but does not supplement per-parameter detail beyond what the schema already provides.

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?

Description states a specific verb+resource: 'Zaktualizuj draft faktury (patch)' – update (patch) the invoice draft – and enumerates the editable field groups (seller/buyer data, number, dates, items). This clearly distinguishes it from siblings like ksef_draft_create, ksef_draft_delete, and ksef_draft_get, and the '(patch)' qualifier signals partial-update semantics.

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?

It gives clear context: this is the tool for partial modifications of an existing draft ('Można zmienić dowolne pola') and imposes an explicit exclusion ('Nie można edytować locked/sent'), preventing misuse on locked or sent drafts. It stops short of naming alternatives or remedies (e.g., using ksef_draft_lock to manege lock state or ksef_draft_validate before updating), so a 5 is not warranted.

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