Skip to main content
Glama
ucetka-mcp

ucetka-mcp

Record received invoice (expense)

add_expense

Record a received invoice (expense) manually when import cannot read the document. Writes the entry with base and VAT, then re-runs the import to clear the matching issue.

Instructions

Record a received invoice (expense) by hand, mainly documents the import could not read (see list_import_issues). Returns a one-line confirmation with base, VAT and whether it is input VAT or reverse-charge self-assessment.

Side effects: writes ~/.ucetka/expenses/<expense_id>.json, then re-runs the received-invoice import so the matching issue disappears. No network. Not idempotent: if expense_id already exists it fails and changes nothing — use remove_expense first to replace a wrong entry. Validation fails on inconsistent reverse-charge, goods or claim_date combinations. Single VAT rate per call. For issued invoices use add_manual_invoice; to mark an existing expense paid use mark_expense_paid.

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": {
      "expense_id": "<expense_id>",
      "supplier_name": "<supplier_name>",
      "document_number": "<document_number>",
      "tax_point_date": "<tax_point_date>",
      "base": "<base>"
    },
    "name": "add_expense"
  }
}

Input Schema

NameRequiredDescriptionDefault
vatNoVAT amount in CZK exactly as on the document. Omitted = base × vat_rate / 100 rounded to 0.01. Under reverse_charge it is the self-assessed VAT.
baseYesTax base (amount without VAT) in CZK, e.g. 1000.00. Convert foreign currency first.
noteNoFree-text note, shown as the subject in the income/expense book.
goodsNoOnly with reverse_charge: True = goods acquired from the EU (VAT return line 3), False = service (default).
pdf_pathNoAbsolute path to the document PDF, as shown by list_import_issues; links the record to the file and clears the issue. Omitted = record without a file.
vat_rateNoVAT rate in percent: 21 (default), 12 or 0. Use 0 for documents without deductible VAT.21
paid_dateNoPayment date YYYY-MM-DD if already paid. With actual-expense bookkeeping an expense counts only once paid. Omitted = unpaid (set later with mark_expense_paid).
claim_dateNoYYYY-MM-DD; set only when a domestic document arrived after the DUZP period was already filed — the VAT deduction is then claimed in this date's period (§ 73). Not before DUZP, not with reverse_charge. Omitted = DUZP period.
expense_idYesExpense ID = PDF file name without extension (e.g. '2603002' for 2603002.pdf); letters, digits, '-' or '_'. Must not exist yet.
supplier_dicNoSupplier's DIČ / VAT ID, e.g. 'CZ12345678' or 'IE3668997OH'. Needed for EU suppliers in the control statement.
supplier_nameYesSupplier's name as on the invoice, e.g. 'Alza.cz a.s.'.
business_shareNoBusiness-use share in percent, 1–100 (phone half private = 50). Default 100.
reverse_chargeNoTrue for a foreign supplier charging no Czech VAT (e.g. Google, cloud/AI services): VAT is self-assessed on both output and input. Requires a non-CZ supplier_country; not combinable with claim_date. Default False.
tax_deductibleNoTrue (default) = deductible for income tax. For a non-deductible document (e.g. hospitality) pass False and vat_rate 0 so no VAT is deducted.
tax_point_dateYesDUZP (tax point date) YYYY-MM-DD from the invoice; decides the VAT period. Also stored as issue date.
document_numberYesThe supplier's own invoice number, e.g. 'FV-2026-0042'.
supplier_countryNoISO alpha-2 country of the supplier's REGISTERED SEAT, e.g. 'IE', 'PL', 'US'; required for reverse_charge. Take it from the address on the invoice, not from the DIČ prefix (a US company with an Irish VAT ID is 'US').

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed22 schema fields changed
    • changedInput schema / properties / base / anyOf
      Previous value: -[
      -  {
      -    "type": "number"
      -  },
      -  {
      -    "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
      -    "type": "string"
      -  }
      -]New value: +[
      +  {
      +    "type": "number"
      +  },
      +  {
      +    "type": "string"
      +  }
      +]
    • changedInput schema / properties / base / description
      Previous value: -"Základ (bez DPH) v Kč."New value: +"Tax base (amount without VAT) in CZK, e.g. 1000.00. Convert foreign currency first."
    • changedInput schema / properties / business_share / description
      Previous value: -"Podíl použití pro podnikání v % (telefon napůl soukromě = 50)."New value: +"Business-use share in percent, 1–100 (phone half private = 50). Default 100."
    • changedInput schema / properties / claim_date / description
      Previous value: -"YYYY-MM-DD: doklad dorazil až po podání období DUZP → odpočet uplatnit v období tohoto data (§ 73)."New value: +"YYYY-MM-DD; set only when a domestic document arrived after the DUZP period was already filed — the VAT deduction is then claimed in this date's period (§ 73). Not before DUZP, not with reverse_charge. Omitted = DUZP period."
    • changedInput schema / properties / document_number / description
      Previous value: -"Číslo faktury dodavatele."New value: +"The supplier's own invoice number, e.g. 'FV-2026-0042'."
    • changedInput schema / properties / expense_id / description
      Previous value: -"ID dokladu = název PDF bez přípony (např. '2603002')."New value: +"Expense ID = PDF file name without extension (e.g. '2603002' for 2603002.pdf); letters, digits, '-' or '_'. Must not exist yet."
    • addedInput schema / properties / expense_id / pattern
      Added value: +"^[A-Za-z0-9_-]{1,40}$"
    • changedInput schema / properties / goods / description
      Previous value: -"Reverse charge: pořízení zboží z EU (ř. 3), jinak služba."New value: +"Only with reverse_charge: True = goods acquired from the EU (VAT return line 3), False = service (default)."
    • changedInput schema / properties / note / description
      Previous value: -"Poznámka."New value: +"Free-text note, shown as the subject in the income/expense book."
    • changedInput schema / properties / paid_date / description
      Previous value: -"Datum úhrady YYYY-MM-DD — při skutečných výdajích se výdaj počítá až zaplacený."New value: +"Payment date YYYY-MM-DD if already paid. With actual-expense bookkeeping an expense counts only once paid. Omitted = unpaid (set later with mark_expense_paid)."
    • changedInput schema / properties / pdf_path / description
      Previous value: -"Cesta k PDF (u flagovaných dokladů z list_import_issues)."New value: +"Absolute path to the document PDF, as shown by list_import_issues; links the record to the file and clears the issue. Omitted = record without a file."
    • changedInput schema / properties / reverse_charge / description
      Previous value: -"Zahraniční služba bez české DPH (Google, OpenAI…) — DPH se samovyměří."New value: +"True for a foreign supplier charging no Czech VAT (e.g. Google, cloud/AI services): VAT is self-assessed on both output and input. Requires a non-CZ supplier_country; not combinable with claim_date. Default False."
    • changedInput schema / properties / supplier_country / anyOf
      Previous value: -[
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]New value: +[
      +  {
      +    "pattern": "^[A-Z]{2}$",
      +    "type": "string"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • changedInput schema / properties / supplier_country / description
      Previous value: -"Země SÍDLA dodavatele (ISO, např. IE, PL, US) — u reverse charge povinné. Podle adresy na faktuře, ne podle prefixu DIČ (Anthropic, PBC s irským DIČ = US)."New value: +"ISO alpha-2 country of the supplier's REGISTERED SEAT, e.g. 'IE', 'PL', 'US'; required for reverse_charge. Take it from the address on the invoice, not from the DIČ prefix (a US company with an Irish VAT ID is 'US')."
    • changedInput schema / properties / supplier_dic / description
      Previous value: -"DIČ / VAT ID dodavatele."New value: +"Supplier's DIČ / VAT ID, e.g. 'CZ12345678' or 'IE3668997OH'. Needed for EU suppliers in the control statement."
    • changedInput schema / properties / supplier_name / description
      Previous value: -"Dodavatel."New value: +"Supplier's name as on the invoice, e.g. 'Alza.cz a.s.'."
    • changedInput schema / properties / tax_deductible / description
      Previous value: -"Daňově uznatelný pro daň z příjmů. Nedaňový doklad (pohoštění…) zadej s vat_rate 0, aby DPH nešlo do odpočtu."New value: +"True (default) = deductible for income tax. For a non-deductible document (e.g. hospitality) pass False and vat_rate 0 so no VAT is deducted."
    • changedInput schema / properties / tax_point_date / description
      Previous value: -"DUZP YYYY-MM-DD."New value: +"DUZP (tax point date) YYYY-MM-DD from the invoice; decides the VAT period. Also stored as issue date."
    • changedInput schema / properties / vat / anyOf
      Previous value: -[
      -  {
      -    "type": "number"
      -  },
      -  {
      -    "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]New value: +[
      +  {
      +    "type": "number"
      +  },
      +  {
      +    "type": "string"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • changedInput schema / properties / vat / description
      Previous value: -"DPH v Kč dle dokladu. Prázdné = dopočítat ze základu."New value: +"VAT amount in CZK exactly as on the document. Omitted = base × vat_rate / 100 rounded to 0.01. Under reverse_charge it is the self-assessed VAT."
    • changedInput schema / properties / vat_rate / anyOf
      Previous value: -[
      -  {
      -    "type": "number"
      -  },
      -  {
      -    "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
      -    "type": "string"
      -  }
      -]New value: +[
      +  {
      +    "type": "number"
      +  },
      +  {
      +    "type": "string"
      +  }
      +]
    • changedInput schema / properties / vat_rate / description
      Previous value: -"Sazba DPH v % (21/12/0)."New value: +"VAT rate in percent: 21 (default), 12 or 0. Use 0 for documents without deductible VAT."
  2. First observedv0.1.0

TDQS

A4.6/5.0
Behavior4/5

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

Goes well beyond the annotations by naming the exact file written (~/.ucetka/expenses/<expense_id>.json), the post-write import re-run, the no-network constraint, non-idempotency with 'fails and changes nothing', and cross-field validation failure modes. This is consistent with readOnlyHint=false and idempotentHint=false. It loses a point only because the 'destructiveHint=false' claim and the practical consequence of a failed partial write are left implicit.

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 purpose, then a 'Side effects' block, then alternatives — a sensible structure for a mutation tool. It is dense but nearly every clause carries distinct information; a few sentences (validation combos) could be tightened.

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 17-parameter mutation with annotations and an output schema, the description supplies the remaining load-bearing facts: side effects, idempotency behavior, failure conditions, and sibling routing. The return value is summarized and an output schema exists, so nothing essential 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, but the description adds cross-parameter constraints the schema cannot express: inconsistent reverse_charge/goods/claim_date combinations fail, and only a single VAT rate is allowed per call. That is genuine semantic value on top of per-field schemas.

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 ('Record a received invoice (expense)') and anchors the use case to documents the importer could not read. It explicitly separates itself from add_manual_invoice (issued invoices) and mark_expense_paid, so an agent can pick it without opening a schema.

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?

Gives the triggering condition (documents the import could not read, cross-referencing list_import_issues) plus explicit exclusions and routing to three siblings: add_manual_invoice, mark_expense_paid, and remove_expense for replacing a wrong entry. Both when-to-use and when-not-to-use are covered.

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