Skip to main content
Glama

update_invoice

Idempotent

Update an existing invoice. Partial update: anything omitted keeps its stored value, BUT items and bill_to are REPLACED as a whole when sent (never merged) — to edit one line item, send the complete new items array. STATE MACHINE: draft → pending → paid, with cancelled reachable from draft or pending. Status "pending" publishes, "cancelled" cancels. Reverting to draft is rejected (400). Paid and cancelled invoices are immutable history — the API answers 409; do not retry, explain to the user. Publishing does NOT email the recipient. Totals are recomputed server-side. Requires the Invoices module enabled — on 403 "module is not enabled", do NOT retry; tell the user to contact Sweeppea support. DISPLAY RULE: never show InvoiceToken UUIDs; use InvoiceNumber when talking to the user.

update_invoice

When to use

Update an existing invoice. Partial update: anything omitted keeps its stored value, BUT items and bill_to are REPLACED as a whole when sent (never merged) — to edit one line item, send the complete new items array. STATE MACHINE: draft → pending → paid, with cancelled reachable from draft or pending. Status "pending" publishes, "cancelled" cancels. Reverting to draft is rejected (400). Paid and cancelled invoices are immutable history — the API answers 409; do not retry, explain to the user. Publishing does NOT email the recipient. Totals are recomputed server-side. Requires the Invoices module enabled — on 403 "module is not enabled", do NOT retry; tell the user to contact Sweeppea support. DISPLAY RULE: never show InvoiceToken UUIDs; use InvoiceNumber when talking to the user.

Pre-calls required

  1. get_invoice — check the current Status before attempting a transition

Parameters to validate before calling

  • invoice_token (string, required) — The invoice token (UUID v4) of the invoice to edit

  • bill_to (object, optional) — FULL replacement of the recipient object, PascalCase keys: {"Name", "Email"} required; optional: Company, Phone, Address, City, State, ZipCode, Country, TaxId (optional)

  • items (array, optional) — FULL replacement of the line items (max 60), PascalCase keys: [{"Description" (required), "Quantity", "Rate"}] (optional)

  • title (string, optional) — Invoice title/concept (max 200 characters, optional)

  • issue_date (string, optional) — Issue date YYYY-MM-DD (optional)

  • due_date (string, optional) — Due date YYYY-MM-DD (optional)

  • discount_amount (number, optional) — Flat discount amount, capped at the subtotal (optional)

  • tax_enabled (boolean, optional) — Apply tax (optional)

  • tax_label (string, optional) — Tax label (optional)

  • tax_rate (number, optional) — range: 0–100 — Tax percentage 0-100 (optional)

  • payment_method (string, optional) — one of: card, check, transfer — Payment method (optional). payment_instructions is cleared when method is "card"

  • payment_instructions (string, optional) — Offline payment instructions for check/transfer (optional)

  • notes_to_recipient (string, optional) — Notes to the recipient (max 3000 characters, optional)

  • terms (string, optional) — Terms and conditions (max 3000 characters, optional)

  • status (string, optional) — one of: pending, cancelled — Status transition (optional): "pending" publishes the draft, "cancelled" cancels. Reverting to draft is not allowed

Notes

  • State machine: draft → pending → paid, with cancelled reachable from draft or pending. Reverting to draft is rejected (400)

  • Paid and cancelled invoices are immutable history — the API answers 409; do not retry, explain to the user

  • Items and BillTo are REPLACED as a whole when sent — to edit one line item, send the complete new array

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
itemsNoFULL replacement of the line items (max 60), PascalCase keys: [{"Description" (required), "Quantity", "Rate"}] (optional)
termsNoTerms and conditions (max 3000 characters, optional)
titleNoInvoice title/concept (max 200 characters, optional)
statusNoStatus transition (optional): "pending" publishes the draft, "cancelled" cancels. Reverting to draft is not allowed
bill_toNoFULL replacement of the recipient object, PascalCase keys: {"Name", "Email"} required; optional: Company, Phone, Address, City, State, ZipCode, Country, TaxId (optional)
due_dateNoDue date YYYY-MM-DD (optional)
tax_rateNoTax percentage 0-100 (optional)
tax_labelNoTax label (optional)
issue_dateNoIssue date YYYY-MM-DD (optional)
tax_enabledNoApply tax (optional)
invoice_tokenYesThe invoice token (UUID v4) of the invoice to edit
payment_methodNoPayment method (optional). payment_instructions is cleared when method is "card"
discount_amountNoFlat discount amount, capped at the subtotal (optional)
notes_to_recipientNoNotes to the recipient (max 3000 characters, optional)
payment_instructionsNoOffline payment instructions for check/transfer (optional)

TDQS

A4.6/5.0
Behavior5/5

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

The description goes far beyond the annotations, which only indicate a mutating, non-destructive, idempotent operation. It discloses the state machine (draft → pending → paid), immutability of paid/cancelled invoices, 409 conflicts, the module-enablement 403, and a display rule about never showing InvoiceToken UUIDs. This adds substantial behavioral context that annotations do not provide.

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

Conciseness2/5

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

The description is highly repetitive: the state machine, the items/bill_to replacement rule, and the get_invoice pre-call are stated multiple times in the opening paragraph, 'When to use', parameter details, and Notes sections. The parameter section mirrors the input schema nearly verbatim. Although the content is front-loaded and uses clear headings, the excessive duplication violates conciseness; every sentence does not earn its place.

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 15-parameter tool with no output schema, the description is exceptionally complete. It covers required pre-calls, parameter validation constraints including PascalCase keys and max lengths, the full state machine, error response handling (400, 403, 409) with explicit do-not-retry advice, the module prerequisite, and a user-facing display rule. This gives an agent everything needed to invoke the tool correctly and handle failures.

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 each parameter already has a description. The tool description adds the overarching partial-update rule (omitted fields keep stored values) and reinforces the full-replacement behavior for items and bill_to, which is also present in the schema. It also adds side-effect context for payment_method (clears payment_instructions) and status transitions. However, the parameter section largely duplicates the schema, so the incremental semantic value is moderate.

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?

The description opens with 'Update an existing invoice', a specific verb+resource pair that clearly distinguishes it from siblings like create_invoice, get_invoice, and delete_invoice. It also immediately outlines partial-update semantics, reinforcing its unique role as a mutating editor of an existing invoice.

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?

The description explicitly states when to use the tool and provides strong operational guidance: a 'Pre-calls required' section mandates calling get_invoice first to check status, and it details error handling for 400, 403, and 409 responses, including 'do not retry' instructions. It also clarifies what does not happen (publishing does not email) and notes the module prerequisite, giving clear context for choosing and invoking this tool.

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.

TDQS

A3.6/5.0
Disambiguation4/5

Most tools follow a clear resource+action pattern (fetch_* for lists, get_* for single items, create/update/delete for writes), making them distinguishable. A few near-overlaps exist (fetch_billing_transactions vs fetch_wallet_transactions, draw_winners vs schedule_drawing) but the descriptions clarify the boundaries.

Naming Consistency4/5

Tool names consistently use snake_case verb_noun, with fetch_ for list operations and get_ for single-item retrieval. Some verb variation (add_participant, count_participants, draw_winners, schedule_drawing) deviates from the dominant create/fetch/update/delete pattern but remains predictable and readable.

Tool Count1/5

With 83 tools, this is far beyond a well-scoped server (typically 3-15, with 25+ considered too many). Even though the platform has broad functionality, the sheer number of tools creates significant agent confusion and selection overhead.

Completeness4/5

The sweepstakes domain is thoroughly covered: lifecycle management, participants, groups, rules, drawings, winners, calendar, notes, todos, tickets, surveys, invoices, billing, files, and entry settings. A few minor gaps exist (e.g., no general participant field update, no archive action) but the surface is remarkably complete for its scope.

Resources