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. Kräver behörigheten book.

Input Schema

TableJSON 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.8/5.0
Behavior5/5

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

Goes well beyond the annotations (which only say non-read-only, non-idempotent, non-destructive): it discloses a side effect (voucher is posted directly), a hard constraint (a configured bokföringstak must not be exceeded), an authorization requirement (permission 'book'), and the return content (voucher number and status).

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?

Dense but front-loaded: purpose first, then alternatives, then side effects, then currency handling. Every sentence carries information, though the single unbroken paragraph could be trimmed or structured slightly for faster scanning.

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 mutation tool with no output schema and no annotations beyond safety flags, the description covers the essential gaps: it describes what is returned (voucher number and status), the posting side effect, the booking-limit constraint, and the permission requirement.

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% with rich per-parameter descriptions and examples, so the baseline is 3. The description adds meaningful semantics for fx_rate/total_sek_ore: they must reflect a rate the user actually supplied and must never be guessed, which is decision-guiding context the schema does not state.

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 (book a supplier invoice) and immediately scopes it: an invoice already registered via create_supplier_invoice. It names the sibling tools it is not (book_voucher, create_voucher), so an agent can distinguish it without opening any 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?

Explicit when-to-use: invoices in leverantörsreskontran, already created by create_supplier_invoice. Explicit alternatives and the reason to prefer this one (correct status, payable via register_supplier_payment), which routes the agent correctly among many booking siblings.

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.

Resources