Skip to main content
Glama
gacabartosz
by gacabartosz

ksef_invoices_query

Read-only

Search Polish KSeF e-invoices by date range and retrieve metadata like KSeF number, NIP, amount, and date. Requires an active session.

Instructions

Wyszukaj faktury w KSeF po zakresie dat. Wymaga aktywnej sesji (ksef_auth_init). Zwraca metadane faktur: numer KSeF, NIP, kwota, data.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dateToNoData do (YYYY-MM-DD) — opcjonalna
dateFromYesData od (YYYY-MM-DD)
dateTypeNoTyp daty: Issue=wystawienia, Invoicing=przyjęcia w KSeF, PermanentStorage=trwałego zapisu
pageSizeNoRozmiar strony (10-100, domyślnie 10)
subjectTypeNoTyp podmiotu: Subject1=sprzedawca, Subject2=nabywca, Subject3=inny, SubjectAuthorized=upoważniony
continuationTokenNoToken kontynuacji z poprzedniego zapytania

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?

Annotations already mark this as readOnlyHint=true, and the description reinforces a non-mutating search behavior. The description adds useful context beyond annotations by stating that an active KSeF session is required and listing the metadata returned. It does not mention pagination despite the continuationToken parameter, but this is a minor gap given the read-only and schema-covered nature of the tool.

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 short, information-dense sentences. The core purpose is front-loaded, followed by the session prerequisite and the returned metadata. No filler or redundant restatement of the tool name.

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 read-only search tool with full schema coverage, the description covers the essential usage context: what it searches, the needed session, and what it returns. It falls short of being fully complete by not mentioning pagination or the continuation token, but the schema makes these recoverable and the tool is otherwise well-specified.

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 description does not need to explain each parameter. It does add the overall date-range concept and return metadata, but it adds no deeper meaning about dateType, pageSize, subjectType, or continuationToken beyond what the schema already provides. Baseline 3 is appropriate.

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?

The description states a specific action ('Wyszukaj faktury w KSeF' - search invoices in KSeF), a clear scope (date range), and the result type (metadata such as KSeF number, NIP, amount, date). This clearly separates it from invoice retrieval/status siblings that focus on a single invoice.

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?

The description gives an explicit prerequisite ('Wymaga aktywnej sesji (ksef_auth_init)'), which is critical for correct usage. It does not explicitly name alternatives or say when not to use this tool, but the context of searching by date and returning metadata is clear enough to guide selection among the many ksef_invoice_* siblings.

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