Skip to main content
Glama

Create invoice

create_invoice

Create a new invoice for a customer. Look up the customer with list_customers first. For each line, use list_products and pass the productId when the product is in the catalog; otherwise omit productId and give name, price and quantity for a one-off line. Lines print in the order given. Options left out use the organization's invoice settings where one exists, otherwise none (no discount, tax, shipping or footer). pdfUrl is a private, signed download link that expires at pdfUrlExpiresAt (1 hour). Give it to the user to open or download the PDF; don't put it in emails, notes, or anything that has to keep working.

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": {
      "customerId": "<customerId>",
      "customerName": "<customerName>",
      "items": "<items>"
    },
    "name": "create_invoice"
  }
}

Input Schema

NameRequiredDescriptionDefault
itemsYesInvoice lines, printed in this order. Mix catalog products and one-off lines freely.
footerNoFooter printed at the bottom of every page. Plain text or simple HTML (p, br, h1-h3, strong, em, u, s, a, ul, ol, li, span with color or text-align); other markup and scripts are removed. An empty string means no footer.
dueDateNoDue date as ISO string (no due date if omitted)
taxRateNoTax rate value e.g. 10 for 10% or fixed amount (default: 0)
taxTypeNoTax type: PERCENT for percentage-based, FIXED for flat amount (default: PERCENT)
currencyNoCurrency code like USD, EUR (from org settings if omitted)
discountNoDiscount as a fixed amount (default: 0)
languageNoLanguage of the printed labels and title. One of: en (English), de (German), fr (French), es (Spanish), pt (Portuguese), it (Italian), ar (Arabic), zh (Chinese), ja (Japanese), kr (Korean), tr (Turkish), az (Azerbaijani)
templateNoPDF design: regular (Regular), bold-professional (Bold Professional), tech-minimal (Mono), startup-modern (Startup Modern)
issueDateNoIssue date as ISO string (defaults to today)
projectIdNoProject ID to link the invoice to
customerIdYesCustomer ID (from list_customers)
dateFormatNoHow dates print. 'Month DD, YYYY' prints December 31, 2025; 'Mon DD, YYYY' prints Dec 31, 2025; 'DD Mon YYYY' prints 31 Dec 2025
endMessageNoNote to the customer printed after the totals e.g. 'Thank you for your business!'. Do NOT put payment terms here.
invoiceModeNoInvoice mode: PRODUCT for goods/services with quantities, HOURLY for time-based billing with hours (default: PRODUCT)
taxIncludedNoWhether tax is already included in item prices (default: false)
assignedToIdNoEmployee ID to assign the invoice to
customFieldsNoAdditional custom fields as label-value pairs e.g. PO number, project reference, printed in this order
customerNameYesThe customer's name as returned by list_customers, echoed back for confirmation. The invoice uses customerId.
invoiceTitleNoDocument title printed at the top, e.g. PROFORMA or RECEIPT (defaults to the translated word for 'Invoice')
shippingCostNoShipping cost (default: 0)
invoiceNumberNoCustom invoice number, unique in the organization (auto-generated if omitted)
currencyFormatNoHow amounts print: NARROW_SYMBOL ($1,234.50), SYMBOL (US$1,234.50), CODE (USD 1,234.50), NAME (1,234.50 US dollars), ACCOUNTING (($1,234.50) for negatives)
termsOfPaymentNoPayment terms shown near the top of the invoice e.g. 'Net 30', 'Due on receipt', 'Payment within 14 days'. Do NOT put thank-you messages here.
paymentMethodIdsNoSaved payment method IDs to print on the invoice. Omitted or empty uses the organization's default payment methods.
acceptOnlinePaymentsNoLet the customer pay online from the shared invoice link. Defaults to on when the organization has an active online payment connection, otherwise off.

Schema Changelog

Changes observed during successful MCP inspections.

No schema history has been recorded yet.

TDQS

A4.4/5.0
Behavior5/5

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

Goes well beyond the annotations by disclosing defaulting behavior for omitted options (org settings where they exist, otherwise no discount/tax/shipping/footer), line ordering semantics, and the critical nature of pdfUrl as a private signed link expiring in one hour that must not be stored or emailed. The annotations only say this is a non-destructive, non-idempotent write; the description supplies the operational consequences.

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-loads the action, then prerequisites, then line construction, then defaults, and finishes with the pdfUrl warning. Every sentence carries a distinct instruction and none repeat schema content verbatim.

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 26-parameter creation tool with no output schema, the description covers the important behavioral corners: prerequisite lookups, mixed line types, defaulting, ordering, and the return artifact (pdfUrl plus its expiry). Nothing an agent needs in order to call this correctly is conspicuously absent.

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?

Schema coverage is 100%, so the baseline is 3, but the description adds cross-field meaning the schema does not: lines print in the order given, and productId presence versus omission determines whether a line is a catalog item or a saved-nowhere one-off. That is genuine value beyond per-parameter descriptions.

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?

Opens with a specific verb and resource: 'Create a new invoice for a customer.' An agent immediately knows the operation and target object. It doesn't explicitly distinguish itself from siblings like create_estimate or update_invoice, which keeps it short of 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 Guidelines4/5

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

Gives concrete workflow guidance: look up the customer with list_customers first, use list_products for catalog items, and omit productId for one-off lines. It does not state when to prefer a sibling such as create_estimate for quotes or update_invoice for edits, so 4 rather than 5.

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