Skip to main content
Glama

Bokför kundinbetalning

register_customer_payment

Bokför en INbetalning på en kundfaktura (D likvidkonto / K 1510). På en kreditfaktura bokförs i stället en återbetalning till kunden av det som inte kvittats mot originalet (D 1510 / K likvidkonto); amount_ore anges positivt. Betalar kunden mer än saldot går överskottet först till påminnelseavgift (3990) och dröjsmålsränta (8313) enligt den senaste påminnelsen, och resten blir en skuld till kunden (status_label Att återbetala). Den återbetalas med samma verktyg och ett POSITIVT amount_ore, som för en kreditfaktura (D 1510 / K likvidkonto). KODEN postar. Kräver scope book; bokföringstaket får inte överstigas. Argument: orgnr, invoice_id, pay_date (YYYY-MM-DD, inte före fakturadatumet), amount_ore; valfritt bank_account (likvidkonto 1900-1999 som debiteras, default 1930). Med kontantmetoden (method=kontant på fakturan) bokförs i stället likvidkontot mot fakturans intäkts- och momskonton i proportion till betalningen, och resten av en överbetalning blir förskott från kunden (2420). Återbetalningen av ett sådant förskott bokförs D 2420 / K likvidkonto.

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>",
      "pay_date": "<pay_date>",
      "amount_ore": "<amount_ore>"
    },
    "name": "register_customer_payment"
  }
}

Input Schema

NameRequiredDescriptionDefault
orgnrYesBolagets organisationsnummer, 10 siffror med eller utan bindestreck, t.ex. 559900-1004. Hämta med list_companies.
pay_dateYes
amount_oreYes
invoice_idYes
bank_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.4/5.0
Behavior5/5

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

Annotations only declare readOnly=false, destructive=false, idempotent=false and openWorld=false. The description goes well beyond that: it discloses the required 'book' scope, the booking-ceiling constraint, the exact debit/credit accounts, the overpayment allocation order (3990, 8313, then customer liability), and the cash-method treatment with advance account 2420. That is substantial behavioral context an agent cannot get from the annotations.

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?

Every sentence carries real information, but it is delivered as one dense paragraph of edge cases with no headings or bullets, making the normal path and the exception paths hard to separate at a glance. It is appropriately sized for the complexity but not well structured.

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 five-parameter mutation tool with no output schema, the definition covers the posting logic, overpayment handling, auth scope and limits. Remaining gaps are the response shape and duplicate-call behavior (relevant given idempotentHint=false), which are not addressed.

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 description coverage is only 20%, so the description must compensate and largely does: it fixes pay_date format and the not-before-invoice-date rule, states that amount_ore is always positive even for refunds, and constrains bank_account to 1900–1999 with default 1930. invoice_id and orgnr are only named, not explained, but orgnr is covered in the schema itself.

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?

The opening clause states a specific verb and resource in accounting terms ('Bokför en INbetalning på en kundfaktura') and immediately frames the counterparty as a customer invoice, which separates it from the supplier-payment sibling. An agent can identify the operation without opening the schema.

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 description gives clear conditional guidance: normal payment on a customer invoice, refund on a credit invoice, overpayment waterfall, and the cash-method variant. It even states that refunds are executed with the same tool. It stops short of naming when to use reverse_customer_payment or other siblings instead, so no explicit exclusion is provided.

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.