Skip to main content
Glama

Ändra kundfaktura

update_customer_invoice
DestructiveIdempotent

Ändra en EJ bokförd kundfaktura (utkast). Bara medskickade fält ändras. Med lines ersätts raderna och total/moms räknas om (per momssats, se create_customer_invoice; skickade total_ore/vat_ore kontrolleras). Scope reconcile. Argument: orgnr, invoice_id; valfritt customer_name, invoice_number, ocr, invoice_date, due_date, total_ore, vat_ore, currency, income_account, rounding_ore, lines, customer_orgnr, customer_address, customer_email, customer_reference, payment_terms, service_description, seller_address, seller_bank, seller_iban, seller_bic, seller_bankgiro, seller_contact, customer_vat_number, customer_country, vat_mode (normal, eu_tjanster, eu_varor; se create_customer_invoice), show_late_interest (false döljer villkoret om dröjsmålsränta på just den här fakturan, true tar bort döljningen; har bolaget dolt villkoret syns det inte ändå), husarbete (ROT/RUT, samma form som i create_customer_invoice; {type: ""} tar bort husarbetet). Köpare som redan finns på fakturan behåller sitt personnummer: utelämna buyers för att behålla dem (avdraget räknas då om), eller hänvisa till en köpare med namn eller det maskerade personnumret ur svaret (t.ex. 19850312-XXXX). Fullständiga personnummer tas inte emot; de läggs in i Kvickd under Kundfakturor (Redigera fakturan). Ändras raderna utan att husarbete skickas med behålls beloppen om de ryms, annars sänks avdraget till högsta möjliga.

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": {
      "orgnr": "<orgnr>",
      "invoice_id": "<invoice_id>"
    },
    "name": "update_customer_invoice"
  }
}

Input Schema

NameRequiredDescriptionDefault
ocrNo
linesNo
orgnrYesBolagets organisationsnummer, 10 siffror med eller utan bindestreck, t.ex. 559900-1004. Hämta med list_companies.
vat_oreNo
currencyNo
due_dateNo
vat_modeNo
husarbeteNo
total_oreNo
invoice_idYes
seller_bicNo
seller_bankNo
seller_ibanNo
invoice_dateNo
rounding_oreNo
customer_nameNo
payment_termsNo
customer_emailNo
customer_orgnrNo
income_accountNo
invoice_numberNo
seller_addressNo
seller_contactNo
seller_bankgiroNo
customer_addressNo
customer_countryNo
customer_referenceNo
show_late_interestNo
customer_vat_numberNo
service_descriptionNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / properties / show_late_interest
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "boolean"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "title": "Show Late Interest"
      +}
  2. Changed3 schema fields changed
    • addedInput schema / properties / customer_country
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "title": "Customer Country"
      +}
    • addedInput schema / properties / customer_vat_number
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "title": "Customer Vat Number"
      +}
    • addedInput schema / properties / vat_mode
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "title": "Vat Mode"
      +}
  3. Changed1 schema field changed
    • addedInput schema / properties / orgnr / description
      Added value: +"Bolagets organisationsnummer, 10 siffror med eller utan bindestreck, t.ex. 559900-1004. Hämta med list_companies."
  4. First observed

TDQS

A4.2/5.0
Behavior5/5

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

Annotations cover the safety profile (destructive, idempotent, not read-only), and the description adds real behaviour on top: sending lines replaces the rows and recomputes total/VAT per rate, supplied total_ore/vat_ore are validated, husarbete amounts are kept if they fit else lowered, {type: ""} removes the deduction, and full personal identity numbers are rejected and must be entered in the Kvickd UI. Those are non-obvious consequences an agent could not infer from the schema.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The critical constraints are front-loaded, but the middle of the description degenerates into a comma-separated dump of 27 argument names that largely repeats the schema, and the long final sentence about husarbete recalculation is hard to parse. It is dense rather than padded, but the structure does not help scanning.

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 30-parameter mutation with no output schema, the description covers the parts that actually cause errors: partial-update semantics, recalculation on line replacement, VAT mode options, and the restricted handling of personal identity numbers. What is missing is any statement of return values or what 'Scope reconcile' implies, but the core failure modes are addressed.

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 only 3%, so the description carries most of the burden; it does add meaning for the tricky fields (vat_mode enum values normal/eu_tjanster/eu_varor, show_late_interest false/true behaviour, husarbete removal, masked buyer reference format). However, roughly two dozen fields are only name-dropped with no semantics, and it discusses a 'buyers' argument that does not appear in the input schema, which weakens precision.

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 (Ändra) and resource (kundfaktura) and immediately narrows scope to 'EJ bokförd' drafts, which cleanly separates it from book_customer_invoice, cancel_customer_invoice and credit_customer_invoice. It also states the patch semantics ('Bara medskickade fält ändras') up front, so an agent knows this is a partial update of a draft.

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 draft-only constraint is an effective when-to-use rule and it points to create_customer_invoice for the vat_mode and husarbete formats. It does not explicitly say what to do when the invoice is already booked (e.g. use cancel/reverse), and 'Scope reconcile' is left unexplained, so the routing guidance is not fully closed.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.