Skip to main content
Glama

Create an invoice

create_invoice

Create a crypto invoice from line items or a single amount, assign a customer, and get a payment URL where the buyer pays in bitcoin or a stablecoin.

Instructions

Create an invoice.

Lines are prices ({ price, quantity }) or your own ({ description, amount, quantity }), in one currency. For a single amount, amount + description is short for one line. customer is an id or { email }. A price line may carry its own description ("Seat #12"), and discount takes an amount off this invoice alone. The buyer pays at url, choosing bitcoin or a stablecoin there. Live mode: a new invoice is refused with 403 bill_overdue while a Perly Pay bill is unpaid past its 14 days, until it is paid in the dashboard's Billing; invoices already made are still paid.

Test keys only: refused with a live key.

Input Schema

NameRequiredDescriptionDefault
amountNoOne amount instead of line_items in minor units (cents), an integer.
couponNo
localeNo
currencyNoFor lines without a price. Default: your account's currency.
customerNoA customer id, or `{ email }` to find or make one.
discountNoA one-off amount off this invoice (a credit you owe the buyer; not with `coupon`) in minor units (cents), an integer.
metadataNoYour own key–value pairs (≤ 50 keys, values ≤ 500 characters). On an update they are merged in; an empty value removes its key.
line_itemsNo
return_urlNoWhere the buyer's page sends them back.
descriptionNoWith `amount`: what it is for.
subscriptionNoA subscription id, `sub_…`.
customer_emailNoWithout `customer`: finds or makes the customer by email.
expires_in_minutesNoUntil when a rail may be chosen.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.3.0

TDQS

A3.8/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=false, openWorldHint=true), the description discloses real operational traits: the 403 `bill_overdue` refusal while a Perly Pay bill is unpaid past 14 days, that already-created invoices are still paid, that test keys only are accepted, and that payment happens out-of-band at `url` in bitcoin or a stablecoin. It stops short of describing what the created object contains or any rate limits, so not a 5.

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?

Front-loaded with the one-line purpose, then dense but non-redundant sentences covering line shapes, customer form, discount scope, payment rail, and key-mode constraints. No filler and no repetition of schema field definitions verbatim.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 13-parameter mutation with nested objects and no output schema, the description covers the primary composition paths and error behavior well, but leaves several parameters (`coupon`, `locale`, `metadata`, `subscription`, `expires_in_minutes`) with no narrative, including `coupon` and `locale` which have no schema description either. It also never indicates what is returned (id, `url`, status), which an agent needs to chain a follow-up retrieve_invoice or simulate_payment call.

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

Parameters4/5

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

With 77% schema coverage the baseline is 3, and the description adds genuine meaning on top: it explains the two line shapes and that `amount` + `description` is shorthand for a single line, that all lines share one currency, that `customer` accepts an id or `{ email }`, and that `discount` is scoped to this invoice alone. It leaves `coupon`, `locale`, `metadata`, `subscription`, and `expires_in_minutes` unaddressed, which keeps it at 4.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The opening line states a specific verb and resource ("Create an invoice"), and the body clarifies the resource's shape (lines, customer, discount, pay url). It never names a sibling it is not, so an agent must still infer when to prefer create_invoice over create_payment_link or create_checkout_session, which keeps it below a 5.

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?

Usage is implied rather than stated: the buyer pays at `url`, and the tool is refused in live mode under an overdue-bill condition or with a live key against test mode. There is no explicit "use X instead when..." routing against the many create_* siblings, so the agent gets context but not alternatives.

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