Skip to main content
Glama

Change a draft invoice

update_invoice_draft
Destructive

Changes a draft invoice: add, remove or change lines. The lines given replace the whole line list, so it must contain every line the draft should keep. Takes the invoiceId and contactId returned when the draft was created.

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": {
      "invoiceId": "<invoiceId>",
      "contactId": "<contactId>",
      "lines": "<lines>"
    },
    "name": "update_invoice_draft"
  }
}

Input Schema

NameRequiredDescriptionDefault
linesYesComplete new line list (replaces all existing lines).
notesNo
dueDateNoISO due date. Omit to keep default.
contactIdYesUUID of the client contact (from create_invoice_draft result).
invoiceIdYesUUID of the draft invoice to update (from create_invoice_draft result).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A3.7/5.0
Behavior4/5

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

Annotations already flag destructiveHint=true and idempotentHint=false, but the description adds the crucial mechanism: the supplied lines replace the entire line list, so anything omitted is lost. That is exactly the context an agent needs to avoid silent data loss, though it does not cover what happens to notes/dueDate on omission or any permission requirements.

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

Conciseness4/5

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

Three tight sentences, with the replace-all hazard placed prominently after the purpose statement. Only mild redundancy with the schema's own wording keeps it from a 5.

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?

For a 5-parameter mutation with no output schema, the definition covers the main danger (line replacement) and the ID provenance. It leaves some gaps: behavior of optional notes/dueDate when omitted, and the failure mode for non-draft invoices.

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 80%, and the description mostly restates what the schema already says (invoiceId/contactId from create_invoice_draft, lines replace all existing lines). It adds emphasis but no new syntax, defaults, or constraints, so the baseline 3 is appropriate.

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?

"Changes a draft invoice: add, remove or change lines" gives a specific verb and resource and implicitly separates it from create_invoice_draft by operating on an existing draft. The scope statement is slightly incomplete, though: the schema also accepts notes and dueDate, which the description never mentions as mutable.

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 only implied by the word "draft" and by the note that IDs come from the create step. There is no explicit statement about when this is the wrong tool (e.g. already-sent invoices, use send_invoice instead) or what happens if the invoice is not a draft.

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