Skip to main content
Glama
xero-mcp

xero-mcp

by david-buck

Update draft Xero invoice

xero_update_draft_invoice

Update a draft invoice using an expected revision to prevent stale writes. Patch individual line items while preserving omitted fields and existing discounts.

Instructions

Update only a DRAFT invoice using expectedRevision from xero_get_invoice. Prefer lineItemPatches for narrow edits: omitted fields and other lines are preserved. lineItems intentionally replaces the complete line set; existing IDs preserve omitted discounts. Returns actual before/after changes and totals. Rejects stale revisions before writing; external edits during the request cannot be locked.

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>",
      "expectedRevision": "<expectedRevision>"
    },
    "name": "xero_update_draft_invoice"
  }
}

Input Schema

NameRequiredDescriptionDefault
dueDateNoReplacement due date as YYYY-MM-DD
invoiceIdYesXero InvoiceID
lineItemsNo
referenceNo
invoiceDateNoReplacement invoice date as YYYY-MM-DD
lineItemPatchesNo
expectedRevisionYesRevision returned by xero_get_invoice; stale reads are rejected

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.4.0

TDQS

A4.9/5.0
Behavior5/5

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

With no annotations supplied, the description carries the full burden and does so well: it discloses that stale revisions are rejected before writing, that external edits during the request cannot be locked, that omitted fields and other lines are preserved, and that existing lineItemIds preserve omitted discounts. It also states what the response contains (actual before/after changes and totals).

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?

Five dense sentences, each conveying a distinct constraint or semantic, with the draft-only restriction and the patch-vs-replace guidance front-loaded. No filler or restatement of the name.

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 7-parameter mutation tool with no annotations and no output schema, the description covers the critical gaps: eligibility (drafts only), concurrency (revision rejection plus the unlocked-window caveat), mutation semantics, and return content. An agent has what it needs to call this correctly without experimentation.

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 57%, and the description compensates by explaining the two distinct write modes and their preservation semantics, plus the provenance and validation behavior of expectedRevision. It stops short of describing the date/reference fields, but the schema descriptions already cover those.

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 ('Update only a DRAFT invoice') with an explicit scope restriction (drafts only) and ties the operation to expectedRevision from xero_get_invoice. It is clearly distinguishable from the create/update-quote siblings by naming the resource and the draft-only constraint.

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?

Explicitly directs narrow edits to lineItemPatches and warns that lineItems replaces the complete line set, giving the agent a concrete rule for choosing between the two mechanisms. It also names xero_get_invoice as the source of expectedRevision, so the prerequisite flow is unambiguous.

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