Skip to main content
Glama

Skapa kundfaktura

create_customer_invoice

Skapa en kundfaktura (utkast; bokförs inte förrän du bokför den). Scope reconcile. Rader: [{description, period?, quantity_milli?, unit_price_ore, vat_rate, account?}] (antal ×1000). Radens account = intäktskonto; utelämnas det används income_account, annars 3001. Utan rader anges total_ore/vat_ore/income_account (enradsläge). Momsen bokförs på rate-specifikt konto (25 %→2610, 12 %→2620, 6 %→2630) så deklarationen hamnar i rätt ruta. Argument: orgnr, customer_name, invoice_number, invoice_date; valfritt lines, due_date, ocr, income_account, total_ore, vat_ore, currency (default SEK), rounding_ore (öresutjämning), customer_orgnr, customer_address, customer_email, customer_reference, payment_terms, service_description, seller_address (avsändarens adress, rullas fram), seller_bank, seller_iban, seller_bic, seller_bankgiro, seller_contact. Ändra i efterhand med update_customer_invoice. ROT/RUT (husarbete till privatperson): märk raderna med husarbete_kind (arbete|material|ovrigt), och för arbetsrader work_type (Skatteverkets kategori, se arbetstyper i list_rot_rut, t.ex. Bygg, El, Vvs, Stadning, Tradgardsarbete) samt hours_milli (arbetade timmar ×1000, krävs även vid fast pris). Skicka husarbete = {type: ROT|RUT, buyers: [{personnummer, name?, amount_ore?}], amount_ore?, property? (fastighetsbeteckning) ELLER brf_orgnr + apartment (bostadsrätt)}. Utan belopp begärs högsta möjliga avdrag (ROT 30 %, RUT 50 % av arbetskostnaden inkl. moms; tak 50 000/75 000 kr per person och år). Svaret har husarbete.to_pay_ore = det kunden betalar och husarbete.missing = det som saknas för bokföring.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
ocrNo
linesNo
orgnrYesBolagets organisationsnummer, 10 siffror med eller utan bindestreck, t.ex. 559900-1004. Hämta med list_companies.
vat_oreNo
currencyNoSEK
due_dateNo
husarbeteNo
total_oreNo
seller_bicNo
seller_bankNo
seller_ibanNo
invoice_dateYes
rounding_oreNo
customer_nameYes
payment_termsNo
customer_emailNo
customer_orgnrNo
income_accountNo
invoice_numberYes
seller_addressNo
seller_contactNo
seller_bankgiroNo
customer_addressNo
customer_referenceNo
service_descriptionNo

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
Behavior4/5

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

With annotations already declaring readOnlyHint=false and destructiveHint=false, the description adds important behavioral context: the invoice is created as a draft, is not booked until booked, and how VAT is posted to rate-specific accounts. It does not cover permissions or idempotency in detail, but the draft/booking distinction is valuable beyond 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.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is long and dense, but front-loads the core draft/creation purpose and then organizes the remaining detail by topic. For a 25-parameter tool it earns most of its length, though the prose could be slightly more scannable.

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?

Given 25 parameters, low schema description coverage, and no output schema, the description is unusually complete: it covers creation semantics, key parameter behavior, ROT/RUT handling, and even relevant output fields for husarbete. It is not exhaustively detailed for every simple parameter, but it provides enough context to invoke the tool correctly.

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?

Schema description coverage is only 4%, so the description must carry parameter meaning, and it does: it describes the lines array shape, milli-units (×1000), account fallback rules, VAT account mapping, and the husarbete object structure. It also lists all argument names and explains critical optional fields, adding substantial semantics beyond the sparse schema.

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 description states a specific verb and resource: 'Skapa en kundfaktura', and clarifies it is a draft that is not booked until booked. It also distinguishes the tool from update_customer_invoice and hints at book_customer_invoice, so an agent can tell it apart from sibling invoice tools.

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?

It clearly establishes the creation context and notes that later changes go through update_customer_invoice. It implies the booking step is separate but does not explicitly state when-not to use this tool versus alternatives such as create_supplier_invoice or credit_customer_invoice.

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