Skip to main content
Glama

Bokför kundfaktura

book_customer_invoice

Bokför en kundfaktura som redan har skapats med create_customer_invoice, så att fordran, intäkt och utgående moms hamnar i huvudboken (D 1510 / K intäkt / K moms på 2611, 2621 eller 2631 beroende på momssats). Använd för fakturor i kundreskontran i stället för book_voucher eller create_voucher, så att fakturan får rätt status och kan betalas av med register_customer_payment. En ROT/RUT-faktura delas: kundens del på 1510 och den preliminära skattereduktionen på 1513 (fordran på Skatteverket); den kräver kompletta uppgifter (se husarbete.missing). Returnerar fakturan med verifikatnummer och status. Bieffekt: verifikatet postas direkt och ett satt bokföringstak får inte överstigas. Med kontantmetoden (method=kontant i svaret) registreras fakturan utan verifikat; intäkt 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_customer_invoice"
  }
}

Input Schema

NameRequiredDescriptionDefault
orgnrYesBolagets organisationsnummer, 10 siffror med eller utan bindestreck, t.ex. 559900-1004. Hämta med list_companies.
confirmNoROT/RUT-faktura när F-skatt inte är angiven i företagsinformationen: true först när användaren har bekräftat att företaget har F-skatt.
invoice_idYesKundfakturans id (heltal), t.ex. 42. Hämta med list_customer_invoices.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / properties / confirm
      Added value: +{
      +  "default": false,
      +  "description": "ROT/RUT-faktura när F-skatt inte är angiven i företagsinformationen: true först när användaren har bekräftat att företaget har F-skatt.",
      +  "title": "Confirm",
      +  "type": "boolean"
      +}
  2. Changed1 schema field changed
    • addedInput schema / properties / invoice_id / description
      Added value: +"Kundfakturans id (heltal), t.ex. 42. Hämta med list_customer_invoices."
  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.6/5.0
Behavior5/5

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

Goes well beyond the annotations by disclosing that the verifikat is posted immediately, that an accounting ceiling ('bokföringstak') must not be exceeded, that the 'book' permission is required, and that under kontantmetoden the invoice is registered without a verifikat and revenue/VAT are booked at payment. These are non-obvious mutation side effects an agent needs before calling.

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 core action and its accounting effect, then layered with routing, exceptions, side effects and permissions in a logical order. It is dense but every sentence carries distinct information; the ROT/RUT sentence is slightly packed but still earns its place.

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 non-idempotent mutation tool with no output schema, the description covers the return value (invoice with verifikatnummer and status), preconditions (permission, accounting ceiling, ROT/RUT data completeness), and the cash-method variant. Nothing essential for calling it correctly is missing.

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 100% and the schema already explains orgnr, invoice_id and confirm individually. The description adds context around the ROT/RUT completeness requirement ('se husarbete.missing') and the confirm semantics, but overall the schema does the heavy lifting, so the baseline of 3 applies.

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 kundfaktura som redan har skapats med create_customer_invoice') and even spells out the resulting ledger entries (D 1510 / K intäkt / K moms 2611/2621/2631). It explicitly separates itself from create_customer_invoice, book_voucher and create_voucher, so an agent can pick it without opening schemas.

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?

Give explicit routing: use this for customer-ledger invoices 'i stället för book_voucher eller create_voucher', and states the reason (correct status, payable via register_customer_payment). It also carves out the cash-method case where no verifikat is created, and calls out the special ROT/RUT scenario with its prerequisite.

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.