Skip to main content
Glama

Backa kundinbetalning

reverse_customer_payment
Destructive

Backa den senaste registrerade inbetalningen på en kundfaktura (postar ett omvänt verifikat, K likvidkonto / D 1510, så fakturan blir obetald igen). En betalning i taget, senast registrerad först, även över räkenskapsår; anropa igen för nästa. KODEN postar. Scope book. Argument: orgnr, invoice_id; valfritt returned=true när betalningen faktiskt gick tillbaka (t.ex. returnerad av banken): motposten bokförs då med dagens datum. Utan returned rättas en felregistrerad betalning. Fråga användaren vilket som gäller; för en faktura med kontantmetoden måste returned anges. Ligger betalningen i ett stängt räkenskapsår går bara returned=true, eller att användaren låser upp året.

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

Input Schema

NameRequiredDescriptionDefault
orgnrYesBolagets organisationsnummer, 10 siffror med eller utan bindestreck, t.ex. 559900-1004. Hämta med list_companies.
returnedNo
invoice_idYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / properties / returned
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "boolean"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "title": "Returned"
      +}
  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.5/5.0
Behavior4/5

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

Beyond the annotations (destructive=true, idempotent=false) the description discloses the actual accounting posts, that the tool itself posts rather than staging a draft ("KODEN postar"), the LIFO selection order, cross-fiscal-year reach, and the date used for the contra entry. It does not state what the response contains or what happens when no payment exists on the invoice.

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: effect first, then ordering, then the returned/organization rules. The one wasted line is "Argument: orgnr, invoice_id", which merely restates required schema fields already visible to the caller.

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 destructive, non-idempotent, no-output-schema mutation, the description covers mechanism, ordering, dating, and error-avoidance preconditions well. It omits return value expectations, permission requirements beyond the terse "Scope book", and whether a reversal can itself be undone.

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 only 33% (invoice_id is undocumented), but the description fully compensates for the ambiguous parameter, returned, explaining both of its meanings, its date effect, and its mandatory status under cash method and closed-year conditions. invoice_id is only named, not explained (e.g., no pointer to which listing supplies it), which keeps this below a 5.

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 ("Backa den senaste registrerade inbetalningen på en kundfaktura") and immediately clarifies the accounting effect (reversing voucher K likvidkonto / D 1510, invoice becomes unpaid again). This clearly separates it from register_customer_payment and reverse_supplier_payment without needing either 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?

Explicitly describes ordering semantics (one payment at a time, most recently registered first, across fiscal years, call again for the next) and gives a concrete decision rule: use returned=true when the money actually went back, omit it to correct a misregistration, and ask the user which applies. It also names two hard preconditions — cash-method invoices require returned, and a closed fiscal year allows only returned=true or an unlocked year.

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.