Skip to main content
Glama

Create invoice

create_invoice
Idempotent

Issues an invoice for an order at its full total, enforcing one invoice per order and rejecting cancelled, refunded, or already-invoiced orders.

Instructions

Issue the invoice for an order (amount = order total). Each order can have only one invoice: a second request is refused with the existing invoice number (CONFLICT). Cancelled and refunded orders cannot be invoiced.

Input Schema

NameRequiredDescriptionDefault
notesNoOptional note printed on the invoice.
order_idYesNumeric order ID, e.g. 1042.
due_in_daysNoPayment terms for unpaid orders (default 14). Paid orders are invoiced as due today.

Output Schema

NameRequiredDescriptionDefault
invoiceYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.2/5.0
Behavior4/5

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

Beyond the annotations (readOnlyHint=false, destructiveHint=false, idempotentHint=true), the description discloses the duplicate-request outcome: a second call is refused with the existing invoice number as a CONFLICT. That is genuinely useful error semantics an agent cannot infer from structured fields, though there is mild tension worth noting — idempotentHint=true while repeats are rejected rather than silently succeeding (the net state is still one invoice, so this is not a contradiction).

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?

Three short sentences, zero filler, with the core action and its derived amount front-loaded and the failure modes packed into the follow-up clauses.

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?

An output schema exists and all three parameters are documented, so the description need not explain return values; it covers the key constraints (uniqueness, conflict, order-state gating). It could still say what happens to the invoice after issuance (e.g., whether it is sent or merely created), which is the main residual gap.

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 description coverage is 100%, so order_id, notes, and due_in_days are already fully documented in the schema, and this establishes a baseline of 3. The description adds only that the amount equals the order total (i.e., it is not a settable parameter), which is minor added meaning.

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 ("Issue the invoice for an order") and immediately pins the derived amount to the order total, so the agent knows exactly what is created. This is clearly distinct from siblings like issue_refund and update_order_status; no overlap is possible.

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?

Explicitly gives the preconditions for use: one invoice per order, and cancelled/refunded orders cannot be invoiced. It does not name an alternative tool or explain what to do instead when refused, but no sibling tool is a real substitute, so the guidance is close to complete.

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