Skip to main content
Glama

Bokför verifikat med källhänvisning

book_voucher

Bokför ett verifikat i huvudboken med debet- och kreditrader och en obligatorisk källhänvisning (basis). Använd när verifikatet bygger på något du har läst i Kvickd, t.ex. en bankrad, en avvikelse eller ett godkänt förslag, och ska kunna spåras dit. Vill du bokföra med tecknade belopp och bifoga kvitton direkt, använd create_voucher; ska en människa granska först, använd propose_voucher. Returnerar verifikatets id, serie och nummer. Bieffekt: verifikatet postas direkt. Koden validerar att debet är lika med kredit, att det finns minst två rader och att perioden inte är låst, och ett satt bokföringstak får inte överstigas. Underlag i annan valuta än SEK: gissa aldrig växelkursen. Fråga användaren efter kursen (SEK per 1 enhet) eller SEK-beloppet (t.ex. det som drogs från kontot), räkna raderna i SEK och ange currency, foreign_amount_minor och fx_rate eller total_sek_ore, så dokumenteras kursen på verifikatet. Ett datum mer än 30 dagar fram kräver confirm=true efter att användaren bekräftat datumet. Rader: [{account, debit_ore, credit_ore, text?}] i öre med exakt ett belopp skilt från noll per rad, eller [{account, amount_ore, text?}] med tecken (debet positivt, kredit negativt). Raderna kommer tillbaka med båda formaten från list_voucher_drafts och get_voucher. 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>",
      "date": "<date>",
      "lines": "<lines>",
      "text": "<text>",
      "basis": "<basis>"
    },
    "name": "book_voucher"
  }
}

Input Schema

NameRequiredDescriptionDefault
dateYes
textYes
basisYes
linesYes
orgnrYesBolagets organisationsnummer, 10 siffror med eller utan bindestreck, t.ex. 559900-1004. Hämta med list_companies.
seriesNoA
confirmNo
fx_rateNo
currencyNo
finding_refNo
proposal_idNo
external_refNo
total_sek_oreNo
foreign_amount_minorNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / properties / external_ref
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "title": "External Ref"
      +}
  2. Changed1 schema field changed
    • addedInput schema / properties / confirm
      Added value: +{
      +  "default": false,
      +  "title": "Confirm",
      +  "type": "boolean"
      +}
  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.7/5.0
Behavior5/5

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

Annotations already declare a non-read-only, non-destructive, non-idempotent, closed-world write, and the description adds real behavior beyond them: the voucher posts immediately, validation requires debit=kredit, at least two lines, an unlocked period and an unexceeded booking cap, and the 'book' permission is required. It also states the >30-day forward-date confirm requirement and the never-guess FX rule.

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?

Purpose and the sibling routing are front-loaded, then constraints and the FX procedure follow in a logical order with no filler. It is dense but long, with several multi-clause sentences that could be split, though essentially every sentence carries operative information.

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 14-parameter mutation with no output schema, the description covers the return values (id, serie, nummer), the validation rules, permissions, date confirmation and the currency workflow. The only gap is the linkage parameters (finding_ref, proposal_id, external_ref, series), whose semantics remain undefined.

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 7% across 14 params, so the description must compensate and largely does: it defines both accepted line shapes (account/debit_ore/credit_ore or signed amount_ore, in öre), the SEK-vs-foreign field combination (currency, foreign_amount_minor, fx_rate or total_sek_ore), and the confirm trigger. It leaves series, finding_ref, proposal_id, external_ref and text unexplained, which keeps it from 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 ('Bokför ett verifikat i huvudboken') with the distinguishing trait (mandatory källhänvisning/basis) and explicitly routes to siblings create_voucher and propose_voucher. An agent can tell it apart from those 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 when-to-use condition ('när verifikatet bygger på något du har läst i Kvickd ... och ska kunna spåras dit') plus two named alternatives with the conditions that select them: create_voucher for signed amounts with receipts, propose_voucher when a human should review first.

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.