Skip to main content
Glama

Bokför leverantörsfaktura

book_supplier_invoice

Bokför en leverantörsfaktura som redan har registrerats med create_supplier_invoice, så att kostnad, ingående moms och leverantörsskuld hamnar i huvudboken (D kostnadskonto + D 2640 / K 2440). Använd för fakturor i leverantörsreskontran i stället för book_voucher eller create_voucher, så att fakturan får rätt status och kan betalas med register_supplier_payment. Returnerar fakturan med verifikatnummer och status. Bieffekt: verifikatet postas direkt och ett satt bokföringstak får inte överstigas. Faktura i annan valuta utan kurs: ange fx_rate eller total_sek_ore som användaren har angett, gissa aldrig. Med kontantmetoden (method=kontant i svaret) registreras fakturan utan verifikat; kostnad och moms bokförs vid betalningen. Kräver behörigheten book.

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": "book_supplier_invoice"
  }
}

Input Schema

NameRequiredDescriptionDefault
orgnrYesBolagets organisationsnummer, 10 siffror med eller utan bindestreck, t.ex. 559900-1004. Hämta med list_companies.
fx_rateNoValfritt: växelkurs i SEK per 1 enhet som användaren har angett, t.ex. 11.42. Bara för faktura i annan valuta som saknar kurs.
invoice_idYesLeverantörsfakturans id (heltal), t.ex. 42. Hämta med list_supplier_invoices.
total_sek_oreNoValfritt, i stället för fx_rate: fakturans totalbelopp i SEK, i öre, som användaren har angett.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changed
    • addedInput schema / properties / fx_rate / description
      Added value: +"Valfritt: växelkurs i SEK per 1 enhet som användaren har angett, t.ex. 11.42. Bara för faktura i annan valuta som saknar kurs."
    • addedInput schema / properties / invoice_id / description
      Added value: +"Leverantörsfakturans id (heltal), t.ex. 42. Hämta med list_supplier_invoices."
    • addedInput schema / properties / total_sek_ore / description
      Added value: +"Valfritt, i stället för fx_rate: fakturans totalbelopp i SEK, i öre, som användaren har angett."
  2. 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."
  3. First observed

TDQS

A4.2/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=false, idempotentHint=false, destructiveHint=false and openWorldHint=false, so the write profile is known. The description still adds real value beyond that: the voucher posts immediately, a configured bokföringstak must not be exceeded, and the 'book' permission is required. It does not cover failure modes or what happens on a limit violation, keeping it below the top of the scale.

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-loaded with the purpose and posting outcome, then alternatives, then side effects and currency caveats. Every sentence carries information, though the parenthetical account codes and the currency sentence make it denser than ideal for a single read.

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?

Covers everything an agent needs for a 4-parameter mutation: prerequisite state, sibling routing, ledger effect, side effects and limits, permission requirement, currency edge case, cash-method exception, and the return value (voucher number and status) even though no output schema exists.

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 coverage is 100%, so both optional currency parameters are already documented in the schema, including the 'instead of fx_rate' relationship. The description adds a genuine operational rule — supply fx_rate/total_sek_ore only as the user gave them and never guess — which is real meaning beyond the schema. That useful addition lifts it slightly, but the schema still carries most of the semantic load.

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 ('Bokför en leverantörsfaktura') plus the exact accounting outcome (D kostnadskonto + D 2640 / K 2440), and explicitly contrasts with book_voucher and create_voucher. An agent can distinguish it from all named siblings 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 an explicit precondition (invoice must already exist via create_supplier_invoice), names the wrong alternatives to avoid, and explains the downstream benefit (correct status, payable via register_supplier_payment). It also flags the cash-method exception path, so the agent knows when the normal posting behavior does not apply.

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.