Skip to main content
Glama

createInvoice

Create a draft invoice for a customer. Returns the created draft, which is not sent to the customer until issueInvoice. Name the customer with the id of a getCustomers match: as invoice.companyRef when its type is company, or as invoice.membershipRef when its type is user; pass invoice.subscriptionRef instead to invoice a subscription. Pass exactly one of the three. The invoice is created in the customer's location and currency. items are custom lines: product.title, a whole quantity, and unitAmount, the price of one unit in major units (12.5 is 12.50), plus tax.rate only to override the location tax rate. Give every item the same companyRef, membershipRef or subscriptionRef as the invoice, and leave invoiceRef, type and discounts out. includeUpcomingItems also adds the customer's pending invoice items. The due date follows the location default unless dueType is date with dueDate or days with dueDays. Call getCustomers to list valid customerRef values. The route is not idempotent: after a failure or timeout, check the result with the list tool before calling again, or a second record is created. Never invent UUIDs; only use values from prior tool responses.

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": {
      "invoice": "<invoice>"
    },
    "name": "createInvoice"
  }
}

Input Schema

NameRequiredDescriptionDefault
itemsNoInvoice items to add on creation.
invoiceYesInvoice to create.
includeUpcomingItemsNoWhether to include upcoming items from active subscriptions.

Output Schema

NameRequiredDescriptionDefault
invoiceYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A5/5.0
Behavior5/5

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

Annotations only tell the agent this is a non-read, non-destructive operation; the description adds the substantive behavior: the record is a draft until issueInvoice, the route is non-idempotent so a retry after timeout can duplicate, currency and location are inherited from the customer, and UUIDs must come from prior tool responses. These are exactly the failure modes an agent needs to avoid.

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?

Dense but front-loaded: creation and draft status come first, then customer ref selection, then item rules, then due dates, then the idempotency warning. Nearly every sentence encodes a distinct rule or constraint rather than restating the schema.

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 mutation with nested item objects and an output schema already documenting the return value, the description covers drafting semantics, ref exclusivity, item shape, due-date defaults, and retry safety. Nothing material for correct invocation is missing.

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?

Although schema coverage is 100%, the description adds meaning the schema cannot express: unitAmount is in major units (12.5 means 12.50), quantity must be whole, tax.rate is only for overriding the location rate, items must repeat the invoice's customer ref, and invoiceRef/type/discounts should be left out. The dueDate/dueDays/dueType interaction is also explained in terms of location defaults.

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 a draft invoice for a customer') and immediately scopes the effect by contrasting with issueInvoice, which sends it. An agent can distinguish this from createInvoiceItem, duplicateInvoice, and issueInvoice without opening any 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?

Explicit routing rules: pass exactly one of companyRef/membershipRef/subscriptionRef, use companyRef only when the customer type is company and membershipRef when it is user, use subscriptionRef to invoice a subscription instead, and call getCustomers for valid refs. It also names the recovery path after failure (check with the list tool before retrying) and directs the agent to issueInvoice for sending.

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