Skip to main content
Glama

Update expense

figa_update_expense
DestructiveIdempotent

Update an expense with an explicit recurrence edit scope. expectedEditContext is the unchanged opaque context of the expense version used for the draft; legacy omission provides no stale-form protection. EXPENSE_WRITE_CONFLICT rejects the entire save without a replacement context. Substituting fresh context on an old draft bypasses that protection. Existing seriesContext, expectedRevision and previewToken requirements still apply. categoryInput omission preserves category; null clears it in the selected scope. Invalid IDs and empty drafts are errors. Named category drafts may create a local sibling distinct from same-named categories elsewhere. Mutually exclusive tagIds/tagInputs replace the tag set; [] clears it and omission preserves it. tagInputs accepts IDs or {name} drafts. ALL_INSTANCES updates defaults and inherited stored tags, including history; explicit/locked overrides remain. FUTURE_INSTANCES starts at the selected scheduled occurrence, or futureFrom on a whole-series target (default now). THIS_INSTANCE sets an override. schedule: null detaches an eligible recurring occurrence with seriesContext and expectedEditContext: THIS_INSTANCE detaches only it; FUTURE_INSTANCES also stops generation and removes later saved unpaid occurrences. singleConversion availability and effect.laterUnpaidCount describe eligibility and destructive impact. Converting an unpaid one-time expense to recurrence requires schedule and THIS_INSTANCE; amountMode is fixed by default or variable for supported rhythms, using its amount as a last_confirmed starting estimate. Existing series change mode through recurringSettings instead. forecastSettings atomically changes ordinary variable settings with ALL_INSTANCES and expectedRevision matching bill settingsRevision. Optional bill confirms/corrects the selected actual invoice independently of editScope, with period, bill revision as expectedRevision, settingsRevision as expectedSettingsRevision, service activityRevision if applicable, and a fresh requestId. Guesses and forecasts are not confirmed invoices. It never marks Paid and is incompatible with amount, schedule, expenseDate, recurringSettings or range. recurringSettings changes mode from canonical scheduled from using FUTURE_INSTANCES and settingsRevision as expectedRevision, with amount for fixed or strategy/startAmount for variable; it is incompatible with amount, schedule, expenseDate or forecastSettings. Existing confirmed invoices/payments remain. range edits effective family boundaries, preserving stored dates, money and payments; omitted end preserves the last term, not the old count. occurrenceDate edits only this occurrence independently of editScope and is incompatible with expenseDate. Range edits require current seriesContext; the outer requestId is their identity, and changes.requestId is omitted or identical. Legacy schedule start-only requires ALL_INSTANCES on the earliest segment and uses range semantics, not rebase. Child segments require range. SERIES_RANGE_SCOPE_REQUIRED/TARGET_REQUIRED indicate wrong scope/segment; SERIES_CONTEXT_REQUIRED/CONFLICT indicate missing/stale context. BILL_OPERATION_REQUIRED excludes service ranges; SERIES_COMPOSITION_UNSUPPORTED excludes rhythm/method changes or whole-period amounts combined with range. Metadata and forecastSettings ALL can share an atomic range save; FUTURE uses the original scheduledDate. Durable rangeOperation receipts outlive the 24-hour transport cache; identical retries retain input/requestId. SERIES_REQUEST_ID_CONFLICT means different input already owns that ID. A replay may contain only rangeOperation; selection.resultExpenseId identifies the resulting expense, and the replay is not a current projection. This tool does not change expense group membership (manual series in the API). A group member cannot become recurring until detached (MANUAL_SERIES_MEMBER_CONVERSION). Changing only schedule.dueWindowEnd preserves all occurrence dates; dueBy is derived on reads. This write requires explicit user intent. A UUID requestId identifies one intended operation; identical retries retain the same ID and payload. A missing response or IDEMPOTENCY_OUTCOME_UNKNOWN, IDEMPOTENT_REQUEST_IN_PROGRESS or INTERNAL_SERVER_ERROR leaves the outcome uncertain, not a confirmed failure. A new ID can duplicate an uncertain write. Corrected inputs after a definite validation or business refusal constitute a new operation. The transport response cache lasts 24 hours; longer replay guarantees are stated above.

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": {
      "workspaceId": "<workspaceId>",
      "requestId": "<requestId>",
      "expenseId": "<expenseId>",
      "changes": "<changes>"
    },
    "name": "figa_update_expense"
  }
}

Input Schema

NameRequiredDescriptionDefault
changesYesFields to change plus editScope and the concurrency expectations described above. Omitted fields stay unchanged.
expenseIdYesExpense ID as returned by expense reads: a stored expense UUID or the ID of a generated occurrence of a recurring series.
requestIdYesCaller-generated UUID identifying this one intended write. A retry of the same write reuses the ID and payload; the same ID with different input returns IDEMPOTENCY_KEY_MISMATCH.
workspaceIdYesID of a workspace selected for this connection. Other workspaces are rejected.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changed
    • addedInput schema / properties / changes / description
      Added value: +"Fields to change plus editScope and the concurrency expectations described above. Omitted fields stay unchanged."
    • addedInput schema / properties / expenseId / description
      Added value: +"Expense ID as returned by expense reads: a stored expense UUID or the ID of a generated occurrence of a recurring series."
    • addedInput schema / properties / requestId / description
      Added value: +"Caller-generated UUID identifying this one intended write. A retry of the same write reuses the ID and payload; the same ID with different input returns IDEMPOTENCY_KEY_MISMATCH."
    • addedInput schema / properties / workspaceId / description
      Added value: +"ID of a workspace selected for this connection. Other workspaces are rejected."
  2. First observed

TDQS

A4/5.0
Behavior5/5

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

Annotations only say destructive + idempotent; the description goes far beyond, spelling out exactly what gets destroyed (FUTURE_INSTANCES stops generation and removes later saved unpaid occurrences), when conflicts abort the whole save (EXPENSE_WRITE_CONFLICT), and stale-context bypass risk. It also details idempotency semantics: 24-hour transport cache versus durable rangeOperation receipts, uncertainty outcomes, and that a new requestId can duplicate an uncertain write. No contradiction with the supplied annotations.

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?

One monolithic paragraph of densely chained clauses with no headings, lists, or front-loading of the core operation; the reader must excavate editScope semantics and the idempotency contract from the middle of the block. Most sentences carry real information, but the lack of structure makes the definition substantially harder to scan than its content warrants.

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 4-parameter tool with deep nested objects and no output schema, it covers scope semantics, range operations, error codes, and return-shape hints (rangeOperation receipts, selection.resultExpenseId, effect.laterUnpaidCount, singleConversion). Given the annotations cover safety and there is no output schema, the remaining gap is mainly return value detail and the untouched simple fields.

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?

Even at 100% schema coverage, it adds meaning the schema cannot express: categoryInput omission preserves versus null clears, tagIds/tagInputs are mutually exclusive with [] clearing and omission preserving, schedule: null detaches, occurrenceDate vs expenseDate, and amountMode/strategy selection for mode changes. Several simpler parameters (name, description, recipientInput) get no treatment, so it is strong but not exhaustive.

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+resource plus the distinguishing constraint ('Update an expense with an explicit recurrence edit scope'), which separates it from read-only siblings and from the create/move tools. It never names the adjacent siblings it overlaps with (figa_update_bill_forecast, figa_confirm_bill, figa_update_manual_series), so differentiation is inferred rather than stated.

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 routing rules: 'Existing series change mode through recurringSettings instead', forecastSettings goes with ALL_INSTANCES and expectedRevision matching bill settingsRevision, and 'This write requires explicit user intent'. It also enumerates incompatibilities (bill vs amount/schedule/expenseDate/recurringSettings/range) and scope requirements with named error codes. What is missing is an explicit statement of when to call a different tool instead of this one as a whole.

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