Skip to main content
Glama

Ändra leverantörsfaktura

update_supplier_invoice
DestructiveIdempotent

Ändra en ännu ej bokförd leverantörsfaktura (bara medskickade fält ändras). Med lines ([{account, net_ore, vat_rate, description?}]) ersätts raderna och total/moms räknas om (skickade total_ore/vat_ore som i create_supplier_invoice); document_id kopplar/ändrar fakturans underlag (PDF) i efterhand. Scope reconcile. Argument: orgnr, invoice_id; valfritt supplier_name, invoice_number, ocr, invoice_date, due_date, total_ore, vat_ore, currency, expense_account, document_id, lines, rounding_ore, fx_rate, total_sek_ore (annan valuta: belopp i fakturans valuta, kurs eller SEK-belopp från ANVÄNDAREN).

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_supplier_invoice"
  }
}

Input Schema

NameRequiredDescriptionDefault
ocrNo
linesNo
orgnrYesBolagets organisationsnummer, 10 siffror med eller utan bindestreck, t.ex. 559900-1004. Hämta med list_companies.
fx_rateNo
vat_oreNo
currencyNo
due_dateNo
total_oreNo
invoice_idYes
document_idNo
invoice_dateNo
rounding_oreNo
supplier_nameNo
total_sek_oreNo
invoice_numberNo
expense_accountNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. 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."
  2. First observed

TDQS

A4.2/5.0
Behavior4/5

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

Annotations already declare destructiveHint=true and idempotentHint=true, so the description earns credit for the operational details instead: lines are replaced wholesale (not merged), totals and VAT are recomputed, and document_id re-links the underlying PDF after the fact. It does not state what happens if the invoice turns out to be booked already (error vs. silent no-op), which matters for a destructive operation.

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 two opening clauses are well front-loaded and high value, but the trailing "Argument:" enumeration partly restates the input schema and bulks up an already dense block of text. Much of it earns its place, yet the list format makes the payload slower to parse than a focused prose description would.

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 16-parameter destructive mutation with almost no schema documentation and no output schema, the description supplies the missing semantics for the nontrivial parameters and the recalculation side effects. The main remaining hole is failure behavior and whether an unbooked-only violation is rejected or ignored.

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?

With only 6% schema coverage, the description carries most of the burden and does a good job: it defines the lines element shape, explains that total_ore/vat_ore follow create_supplier_invoice semantics and are recalculated, describes document_id's re-linking behavior, and explains currency/fx_rate/total_sek_ore must come from the user. Several parameters (ocr, rounding_ore, expense_account, invoice_date, due_date) remain unexplained in both schema and description.

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 ("Ändra en ... leverantörsfaktura") and adds the critical scope constraint that it applies only to invoices not yet booked, which separates it from book_supplier_invoice and cancel_supplier_invoice. It also clarifies partial-update semantics ("bara medskickade fält ändras") up front.

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 "ännu ej bokförd" precondition plus the partial-update rule give a clear condition for use, and "Scope reconcile" indicates the authorization context. It stops short of explicitly naming the sibling to use when the invoice is already booked or when creating a new one, so the agent must infer the alternative.

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.