Skip to main content
Glama

credit_invoice

Create a full credit note for an invoice to process refunds or returns, booking the invoice first when required.

Instructions

Create a FULL credit note for an invoice (refund/return). Fortnox only credits BOOKED invoices; set bookkeep_first=true to book it first. Booking a full credit note puts the goods back in stock — don't add a manual inbound as well. Partial refund: credit, then update_invoice on the credit note to trim its rows.

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": {
      "document_number": "<document_number>"
    },
    "name": "credit_invoice"
  }
}

Input Schema

NameRequiredDescriptionDefault
dry_runNo
bookkeep_firstNo
document_numberYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.3.0

TDQS

A4.3/5.0
Behavior4/5

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

With no annotations at all, the description carries the full behavioral burden and does most of it well: it discloses a hard external constraint (Fortnox only credits BOOKED invoices), explains the bookkeep_first side effect, and warns about the inventory side effect (goods return to stock) that would otherwise cause a double-count. It stops short of covering irreversibility, what happens on an already-credited invoice, or error behavior.

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 the purpose, then the prerequisite, then the side-effect warning, then the partial-refund alternative — a sensible priority order with no filler. It is slightly dense and run-on across line breaks, but every clause carries operational 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 mutating, no-annotation, no-output-schema tool this covers the highest-risk facts: booking prerequisite, inventory side effect, and the partial-refund escape hatch. Remaining gaps are dry_run semantics and failure/reversal behavior, which are real but secondary.

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

Parameters3/5

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

Schema coverage is 0%, so the schema contributes nothing and the description must compensate. It explains bookkeep_first thoroughly and implies document_number is the target invoice, but dry_run is never mentioned anywhere — an agent gets zero semantic detail on one of three parameters, capping this at a middling score.

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 plus scope in the first clause: 'Create a FULL credit note for an invoice (refund/return).' The word FULL immediately distinguishes it from the partial-refund path it goes on to describe, so an agent can tell this apart from create_invoice and update_invoice 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 explicit when-to-use (booked invoices, full credit), a prerequisite workaround (set bookkeep_first=true to book first), and a named alternative workflow for the other case ('Partial refund: credit, then update_invoice on the credit note to trim its rows'). It also tells the agent what not to do (don't add a manual inbound as well), which is the kind of exclusion most definitions omit.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.