inFakt MCP server tool · Invoice drafts and approval
infakt_invoice_internal_prepare
Last updated: · Prepare Internal Invoice
Draft of an internal invoice for a given transaction kind, with no buyer.
What it does
The server’s own text, in Polish, written for the assistant. Names of other tools link to their pages.
Przygotuj fakturę wewnętrzną dla wskazanego rodzaju transakcji, bez tworzenia jej w inFakt.
When to use
Nowy projekt faktury wewnętrznej, jego kolejna wersja albo kopia istniejącej faktury wewnętrznej (source_invoice_uuid).
What it returns
Bez nabywcy: rodzaj transakcji, data wystawienia i pozycje ze stawką VAT (23, 8, 5, 0) oraz wartością netto albo brutto jako tekst dziesiętny PLN. Kopia przenosi tylko rodzaj transakcji i w każdej pozycji stawkę oraz jedną podstawę (netto; brutto, gdy tylko ona odtwarza kwoty źródła); datą wystawienia jest dzisiejsza data (Europe/Warsaw). Numer, status, sumy, uwagi, płatności, KSeF i identyfikatory nie są kopiowane. Stawka spoza 23, 8, 5, 0 daje needs_input. Na koncie ryczałtowym nonaccounting_sales daje needs_input transaction_kind_symbol/flat_rate_account_unsupported (API inFakt nie przyjmuje stawki ryczałtu); pozostałe rodzaje transakcji jej nie wymagają.
How to use
Kopia: source_invoice_uuid tylko przy tworzeniu projektu (bez draft_pid); pola w invoice, np. invoice_date, nadpisują skopiowane. Brak pola zachowuje wartość, null ją czyści. Pozycje zmieniaj przez line_changes. Kopia wymaga nowej zgody użytkownika.
Schema
infakt_meta_schema("invoice_draft"), przykłady: infakt_meta_examples("prepare_internal_invoice").
Related tools (per the server)
- infakt_get_invoices_list - UUID źródła (invoice_type internal)
- infakt_invoice_approve - utworzenie projektu po zgodzie użytkownika
- infakt_invoice_operation_get - wynik tworzenia
Parameters
Fields of the params object. Types and field descriptions come from the schema the server publishes in tools/list.
| Parameter | Type | Required | Description |
|---|---|---|---|
draft_pid | string | no | |
expected_revision | integer (≥ 1) | no | |
invoice | object (invoice_date, notes, services, transaction_kind_symbol) | no | Zmienione pola wersji projektu; brak pola zachowuje wartość, null ją czyści. |
line_changes | list of object (max 1000) | no | |
source_invoice_uuid | UUID | no | Kopia faktury wewnętrznej; źródło odczytywane tylko przy tworzeniu projektu. |
Access kind and annotations
Write through a draft and approval: the tool builds a draft outside inFakt; the document is created after the user approves it
readOnlyHint: falsewrite: changes data or statedestructiveHint: truedestructive: may overwrite or delete data, or cannot be undoneidempotentHint: falsenon-idempotent: each call may add something newopenWorldHint: falseworks only within the inFakt account
OAuth scopes the tool requires:
api:invoices:writeapi:invoices:readapi:account:read
Related tools
- infakt_meta_schema – YAML schema of a resource.
- infakt_meta_examples – Example calls for an operation.
- infakt_get_invoices_list – Lists invoices of one type with date, number and period filters; returns the basic fields by default, the rest via
fields=. - infakt_invoice_approve – Shows the full draft preview and waits for the user’s decision; the only way a draft becomes a document.
- infakt_invoice_operation_get – Result of an issue operation; creates no invoice and starts no sending.