Skip to main content
Glama

Create an invoice

invoice_create

Create a client invoice from line items, with automatic numbering, discounts, tax rates, and totals.

Instructions

Create an invoice for a client from a list of items. Allocates the next invoice number (never reused) and returns the stored invoice with its subtotal, discount, one tax line per rate and the total.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
itemsYesLine items. Amounts are held as integer minor units and every line is rounded first, then summed, so the printed lines can never disagree with the total. A line may carry its own currency
notesNoFree text printed under the totals
clientYesClient name or id. Unknown names are added automatically
currencyNoInvoice currency, 3-letter ISO code. Defaults to the one currency every item agrees on, else your business default. Every line on one invoice must agree with it; a mix is refused with the exact conversion argument to pass rather than billed as if it were one currency
due_daysNoDays until due, defaults to your payment terms
issue_dateNoYYYY-MM-DD, defaults to today
discount_percentNoDiscount percent applied to every line before tax, 0-100

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.20.0

TDQS

A4/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does meaningful work: it discloses that a new invoice number is allocated and never reused, that the invoice is persisted ('stored'), and that the call returns subtotal, discount, per-rate tax lines and total. These are behavioral facts beyond the bare 'create' verb, though side effects like auto-creating unknown clients appear only in the schema.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

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

Two sentences with zero filler; the core purpose is front-loaded and the second sentence packs the key behaviors (numbering, return shape). Every phrase earns its place.

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 7-param creation tool with no annotations and no output schema, the description covers the essential procedural facts — number allocation, persistence, return structure — while the richly detailed schema handles currency-mixing refusal, aliases, and D-R24/D-R46 rounding rules. The division of labor is sensible; the description would only need to add more if the schema were thinner.

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 100%, so the baseline is 3 and the schema already documents all 7 parameters in detail. The description adds marginal context by hinting that discount and per-rate tax lines appear in the returned invoice, mapping loosely to discount_percent and tax_rate, but it adds no syntax or format detail beyond the 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?

States a specific verb and resource ('Create an invoice') plus the exact scope ('for a client from a list of items'). The qualifier 'from a list of items' distinguishes it from siblings like invoice_from_hours and invoice_generate_due without opening their schemas.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The phrase 'from a list of items' implies the itemized-billing use case, but the description never names alternatives or states when not to use it. No explicit exclusion routes the agent toward invoice_from_hours or invoice_generate_due; the usage is inferred rather than stated.

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

Install Server

Other Tools