Skip to main content
Glama

Bokför verifikat med underlag

create_voucher

Bokför ett verifikat i huvudboken med tecknade belopp (debet positivt, kredit negativt), som när en människa använder bokföringsformuläret i appen. Använd för fristående bokningar, t.ex. skatteberäkningens poster efter godkännande, och när kvitton eller fakturor ska kopplas direkt via document_ids eller underlag_ids. Ska verifikatet hänvisa till källor (basis), använd book_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 summan blir 0 och att det finns minst två rader, 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. Kräver behörigheten book.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dateYes
rowsYes
textYes
orgnrYesBolagets organisationsnummer, 10 siffror med eller utan bindestreck, t.ex. 559900-1004. Hämta med list_companies.
seriesNoA
fx_rateNo
currencyNo
document_idsNo
underlag_idsNo
total_sek_oreNo
foreign_amount_minorNo

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

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

Goes well beyond the annotations: it discloses the side effect that the voucher is posted immediately, the validation constraints (sum must be 0, at least two rows, booking ceiling must not be exceeded), the required 'book' permission, and non-obvious FX handling rules (never guess the rate, ask the user). Annotations only supply the generic write/non-idempotent profile, so this added context is genuinely valuable.

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-loads purpose, usage, and sibling routing before the denser validation and FX paragraphs, which is the right order. The FX guidance is long, but every sentence carries non-recoverable domain information, so it is dense rather than padded.

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 complex financial mutation with 11 parameters, no enum constraints, and no output schema, the description supplies validation rules, permission requirements, FX workflow, and even the return shape (id, serie, nummer). An agent has what it needs to call this correctly without external documentation.

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 9% (just orgnr), so the description has to compensate, and it does for the hard parts: the debet/kredit sign convention for rows, the role of document_ids/underlag_ids, and the currency/foreign_amount_minor/fx_rate/total_sek_ore interplay. It leaves date, text, and series semantics unexplained, so it is helpful but not complete across all 11 parameters.

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') plus the amount-sign convention (debet positivt, kredit negativt) that defines its behavior. It explicitly distinguishes itself from book_voucher and propose_voucher, so an agent can place it against siblings 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?

Gives concrete when-to-use cases (fristående bokningar, skatteberäkningens poster after approval, kvitton/fakturor linked via document_ids or underlag_ids) and explicit when-not routing ('använd book_voucher' for basis references, 'propose_voucher' if a human must review first). The selection logic between the three siblings is handed to the agent directly.

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