Skip to main content
Glama

Registrera leverantörsfaktura

create_supplier_invoice

Registrera en leverantörsfaktura (bokförs inte förrän du bokför den med book_supplier_invoice). Scope reconcile. Ange antingen kontorader (lines = [{account, net_ore, vat_rate, description}]; momsen räknas per momssats på summan av raderna, avrundad till närmaste öre, och total härleds ur raderna + rounding_ore. Skicka gärna med fakturans vat_ore och total_ore: har leverantören avrundat momsen annorlunda används dess moms om skillnaden ryms i avrundningen, högst ett öre per rad; större skillnader och en total som inte går ihop avvisas) ELLER enradsläget (total_ore + vat_ore + expense_account). document_id kopplar ett underlag (fakturans PDF från inkorg/dokument, se list_available_underlag). ANNAN VALUTA än SEK (currency, t.ex. EUR/USD): ange beloppen som på fakturan (hundradelar i fakturans valuta) och fx_rate (SEK per 1 enhet) ELLER total_sek_ore (totalbelopp i SEK) som ANVÄNDAREN har angett. Gissa aldrig kursen: fråga användaren. Klienter med stöd för elicitation får frågan direkt; annars returneras ett fel med frågan. Kvickd räknar om till SEK och sparar originalbelopp och kurs. Argument: orgnr, supplier_name, invoice_number, invoice_date; valfritt lines, rounding_ore, total_ore, vat_ore, due_date, ocr, currency, fx_rate, total_sek_ore, expense_account, supplier_id, document_id, delivery_date (leveransdatum när det skiljer sig från fakturadatumet, t.ex. en förskottsfaktura). Köp med omvänd moms (konto 4415-4427 och 4515-4537): momssatsen på raden är 0; Kvickd bokför utgående och ingående moms. Import av varor: bokför varorna på ett vanligt inköpskonto (t.ex. 4010); importmomsen bokförs efter Tullverkets beslut med ett eget verifikat på beslutets datum: D 4545 / K 4598 för beskattningsunderlaget (ruta 50) och D 2645 / K 2615 för momsen (4546/2625 för 12 %, 4547/2635 för 6 %). Kontona 4545-4547 och 4085-4087 nekas på leverantörsfakturan.

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>",
      "supplier_name": "<supplier_name>",
      "invoice_number": "<invoice_number>",
      "invoice_date": "<invoice_date>"
    },
    "name": "create_supplier_invoice"
  }
}

Input Schema

NameRequiredDescriptionDefault
ocrNo
linesNo
orgnrYesBolagets organisationsnummer, 10 siffror med eller utan bindestreck, t.ex. 559900-1004. Hämta med list_companies.
fx_rateNo
vat_oreNo
currencyNoSEK
due_dateNo
total_oreNo
document_idNo
supplier_idNo
invoice_dateYes
rounding_oreNo
delivery_dateNo
supplier_nameYes
total_sek_oreNo
invoice_numberYes
expense_accountNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / properties / delivery_date
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "title": "Delivery Date"
      +}
  2. Changed6 schema fields changed
    • addedInput schema / properties / total_ore / anyOf
      Added value: +[
      +  {
      +    "type": "integer"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • changedInput schema / properties / total_ore / default
      Previous value: -0New value: +null
    • removedInput schema / properties / total_ore / type
      Removed value: -"integer"
    • addedInput schema / properties / vat_ore / anyOf
      Added value: +[
      +  {
      +    "type": "integer"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • changedInput schema / properties / vat_ore / default
      Previous value: -0New value: +null
    • removedInput schema / properties / vat_ore / type
      Removed value: -"integer"
  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
Behavior4/5

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

Goes well beyond the annotations (readOnlyHint=false, destructiveHint=false): discloses that nothing is posted, how VAT is computed and rounded per rate, that supplier-reported VAT is accepted only within one öre per row and larger mismatches are rejected, and that missing FX rates trigger an elicitation question or an error. The only gap is what the successful response looks like, which is partially covered by the implicit "invoice created, not booked" statement.

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 purpose and booking scope, and nearly every sentence carries operational weight. It loses a point for being one dense unbroken block where the reverse-VAT and import-VAT accounting rules could be visually separated from the parameter instructions.

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 17-parameter mutation with no output schema, the definition covers the failure modes an agent would otherwise hit blind: rejected account ranges (4545-4547, 4085-4087), rounding rejections, the no-guessing FX rule, and the elicitation fallback. Nothing essential to a correct call is left unstated.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With only 6% schema description coverage, the description carries the load and does: it spells out the lines object shape ({account, net_ore, vat_rate, description}), explains rounding_ore versus total_ore reconciliation, currency/fx_rate/total_sek_ore semantics (amounts in the invoice currency, fx_rate as SEK per unit), delivery_date for advance invoices, and expense_account for single-line mode.

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 ("Registrera en leverantörsfaktura") and immediately scopes it against the sibling that finishes the job: "bokförs inte förrän du bokför den med book_supplier_invoice". An agent can distinguish create from book from the first sentence alone.

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?

Explicit routing: use this to register, use book_supplier_invoice to post, and use list_available_underlag to find the PDF for document_id. It also lays out two mutually exclusive input modes ("ELLER enradsläget") so the agent knows which shape to send, plus when to ask the user for an FX rate.

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.