Skip to main content
Glama

wariwari

Edit an expense

update_expense
Destructive

Use this to change an expense. Send only the fields that change; expectedRevision is the lockVersion from get_transaction, and a stale one means someone else edited it, so read it again first. A new amountCents re-divides an equal split; for any other split type, send splits with the new amounts too.

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": {
      "groupToken": "<groupToken>",
      "transactionToken": "<transactionToken>",
      "expectedRevision": "<expectedRevision>"
    },
    "name": "update_expense"
  }
}

Input Schema

NameRequiredDescriptionDefault
dateNoThe day it was paid, `YYYY-MM-DD`. Omit to keep it.
splitsNoWho shares the expense, replacing every split. Omit to keep them: a new total re-divides an `equal` split, any other type needs its splits resent. For `equal`, list the members and omit `amountCents`: the server divides the total, odd cents to the first members in the group's order. For `amount`, `percentage` and `shares`, give each member's `amountCents`; they must add up to the total (exactly for `amount`, otherwise within 1 per member).
currencyNoOmit to keep it. One other than the group's is converted into the group currency at the rate on `date`.
splitTypeNoHow the total is divided. `equal` divides it for you; for any other type each split carries its own `amountCents`.
timeOfDayNoTime of day, `HH:MM` (24-hour). Omit to keep it.
groupTokenYesThe group's token, from `listGroups` or `listSearchResults`.
amountCentsNoThe total in minor units of `currency` (¥1,000 is 1000, $12.50 is 1250).
descriptionNoWhat the expense was for, as the group will see it.
categoryTokenNoOmit to keep the category; `null` clears it.
balanceCurrencyNoCurrency bucket used for balances. Omit to keep the current value, unless the edit changes the amount or currency: then it moves to the group currency. Only the group currency or the transaction's own `currency` is kept; any other value (such as the group's previous currency) means the group currency. Changing the group currency re-expresses balances without changing any transaction's `lockVersion`.
expectedRevisionYesThe `lockVersion` the client last saw on the record it is changing. A mismatch is `409 CONFLICT` with the record as the server now has it.
transactionTokenYesThe expense or payment's token, from `listTransactions` or `listSearchResults`.
paidByParticipantTokenNoThe member who paid, by token from `showGroup`. Omit to keep it.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed20 schema fields changed
    • addedInput schema / $defs / SplitInput / properties / amountCents / description
      Added value: +"This member's share in minor units of the expense's currency."
    • removedInput schema / $defs / SplitInput / properties / participantToken / $ref
      Removed value: -"#/$defs/Token"
    • addedInput schema / $defs / SplitInput / properties / participantToken / allOf
      Added value: +[
      +  {
      +    "$ref": "#/$defs/Token"
      +  }
      +]
    • addedInput schema / $defs / SplitInput / properties / participantToken / description
      Added value: +"A member who shares the expense, by token from `showGroup`."
    • addedInput schema / properties / amountCents / description
      Added value: +"The total in minor units of `currency` (¥1,000 is 1000, $12.50 is 1250)."
    • removedInput schema / properties / currency / $ref
      Removed value: -"#/$defs/Currency"
    • addedInput schema / properties / currency / allOf
      Added value: +[
      +  {
      +    "$ref": "#/$defs/Currency"
      +  }
      +]
    • addedInput schema / properties / currency / description
      Added value: +"Omit to keep it. One other than the group's is converted into the group\ncurrency at the rate on `date`.\n"
    • addedInput schema / properties / date / description
      Added value: +"The day it was paid, `YYYY-MM-DD`. Omit to keep it."
    • addedInput schema / properties / description / description
      Added value: +"What the expense was for, as the group will see it."
    • removedInput schema / properties / paidByParticipantToken / $ref
      Removed value: -"#/$defs/Token"
    • addedInput schema / properties / paidByParticipantToken / allOf
      Added value: +[
      +  {
      +    "$ref": "#/$defs/Token"
      +  }
      +]
    • addedInput schema / properties / paidByParticipantToken / description
      Added value: +"The member who paid, by token from `showGroup`. Omit to keep it."
    • removedInput schema / properties / splitType / $ref
      Removed value: -"#/$defs/SplitType"
    • addedInput schema / properties / splitType / allOf
      Added value: +[
      +  {
      +    "$ref": "#/$defs/SplitType"
      +  }
      +]
    • addedInput schema / properties / splitType / description
      Added value: +"How the total is divided. `equal` divides it for you; for any other type\neach split carries its own `amountCents`.\n"
    • addedInput schema / properties / splits / description
      Added value: +"Who shares the expense, replacing every split. Omit to keep them: a new\ntotal re-divides an `equal` split, any other type needs its splits resent.\nFor `equal`, list the members and omit `amountCents`: the server divides\nthe total, odd cents to the first members in the group's order. For\n`amount`, `percentage` and `shares`, give each member's `amountCents`; they\nmust add up to the total (exactly for `amount`, otherwise within 1 per member).\n"
    • removedInput schema / properties / timeOfDay / $ref
      Removed value: -"#/$defs/TimeOfDay"
    • addedInput schema / properties / timeOfDay / allOf
      Added value: +[
      +  {
      +    "$ref": "#/$defs/TimeOfDay"
      +  }
      +]
    • addedInput schema / properties / timeOfDay / description
      Added value: +"Time of day, `HH:MM` (24-hour). Omit to keep it."
  2. Changed20 schema fields changed
    • addedInput schema / $defs / SplitInput
      Added value: +{
      +  "additionalProperties": false,
      +  "description": "`amountCents` is each participant's share. With `splitType: equal`\nit may be omitted from every split, and the server divides the\namount evenly (leftover cents go to the first participants). A split\nof zero leaves that participant out; no zero split is stored.\n",
      +  "properties": {
      +    "amountCents": {
      +      "minimum": 0,
      +      "type": "integer"
      +    },
      +    "participantToken": {
      +      "$ref": "#/$defs/Token"
      +    }
      +  },
      +  "required": [
      +    "participantToken"
      +  ],
      +  "type": "object"
      +}
    • changedInput schema / $defs / Token / description
      Previous value: -"Resource token. 24 characters of base58 (`SecureRandom.base58(24)` —\nthe alphabet excludes the visually-confusable `0`, `O`, `I`, `l`).\nTokens are stable across edits. Most public resources receive a\nserver-generated token on creation; group creation may also accept\nclient-supplied participant tokens for offline/import flows.\n"New value: +"Resource token: 24 base58 characters (the alphabet leaves out the\nlook-alikes `0`, `O`, `I` and `l`). A token never changes. The server\ngenerates one when a create sends none; a client may choose its own for a\ntransaction, participant, category or recurring expense, so a write queued\noffline already knows the token it will have.\n"
    • removedInput schema / $defs / TransactionKind
      Removed value: -{
      -  "description": "`expense` is normal spending; `payment` is money sent from one\nparticipant to another to settle balances.\n",
      -  "enum": [
      -    "expense",
      -    "payment"
      -  ],
      -  "type": "string"
      -}
    • removedInput schema / properties / category
      Removed value: -{
      -  "maxLength": 40,
      -  "minLength": 1,
      -  "type": "string"
      -}
    • addedInput schema / properties / categoryToken
      Added value: +{
      +  "description": "Omit to keep the category; `null` clears it.",
      +  "oneOf": [
      +    {
      +      "$ref": "#/$defs/Token"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ]
      +}
    • addedInput schema / properties / expectedRevision
      Added value: +{
      +  "description": "The `lockVersion` the client last saw on the record it is changing. A mismatch is `409 CONFLICT` with the record as the server now has it.",
      +  "minimum": 0,
      +  "type": "integer"
      +}
    • removedInput schema / properties / groupCategoryToken
      Removed value: -{
      -  "description": "Omit to keep the category; `null` clears it.",
      -  "oneOf": [
      -    {
      -      "$ref": "#/$defs/Token"
      -    },
      -    {
      -      "type": "null"
      -    }
      -  ]
      -}
    • addedInput schema / properties / groupToken / description
      Added value: +"The group's token, from `listGroups` or `listSearchResults`."
    • removedInput schema / properties / kind
      Removed value: -{
      -  "allOf": [
      -    {
      -      "$ref": "#/$defs/TransactionKind"
      -    }
      -  ],
      -  "description": "Use `payment` for settlement payments."
      -}
    • removedInput schema / properties / lockVersion
      Removed value: -{
      -  "description": "Latest lock version from the transaction being updated.",
      -  "minimum": 0,
      -  "type": "integer"
      -}
    • addedInput schema / properties / paidByParticipantToken
      Added value: +{
      +  "$ref": "#/$defs/Token"
      +}
    • removedInput schema / properties / paidByToken
      Removed value: -{
      -  "$ref": "#/$defs/Token"
      -}
    • addedInput schema / properties / splits / items / $ref
      Added value: +"#/$defs/SplitInput"
    • removedInput schema / properties / splits / items / additionalProperties
      Removed value: -false
    • removedInput schema / properties / splits / items / description
      Removed value: -"Same rules as TransactionCreate splits; `amountCents` may be omitted from every split for an equal split."
    • removedInput schema / properties / splits / items / properties
      Removed value: -{
      -  "amountCents": {
      -    "minimum": 0,
      -    "type": "integer"
      -  },
      -  "participantToken": {
      -    "$ref": "#/$defs/Token"
      -  }
      -}
    • removedInput schema / properties / splits / items / required
      Removed value: -[
      -  "participantToken"
      -]
    • removedInput schema / properties / splits / items / type
      Removed value: -"object"
    • addedInput schema / properties / transactionToken / description
      Added value: +"The expense or payment's token, from `listTransactions` or `listSearchResults`."
    • changedInput schema / required
      Previous value: -[
      -  "groupToken",
      -  "transactionToken",
      -  "lockVersion"
      -]New value: +[
      +  "groupToken",
      +  "transactionToken",
      +  "expectedRevision"
      +]
  3. First observed

TDQS

A4.1/5.0
Behavior4/5

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

The annotations already declare destructiveHint=true and readOnlyHint=false, so the description is free to add value, and it does: patch semantics (only changed fields), optimistic concurrency via expectedRevision, the stale-revision conflict outcome, and the split re-division consequence of changing amountCents. It stops short of describing the response payload or what happens to balance/currency bucketing on edit, which the schema covers instead.

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, front-loaded with purpose and then the two highest-risk behaviors (concurrency and split recalculation). The opener is mildly filler-ish but the rest is dense and non-redundant.

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 13-parameter destructive mutation with no output schema, the description covers the pieces an agent could realistically get wrong: partial updates, revision conflicts, and split re-derivation. Remaining details (currency conversion, balance bucket, category clearing) are fully documented in the schema, and safety is covered by annotations.

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; the description earns above that by tying expectedRevision to the concrete source of truth (lockVersion from get_transaction) and by explaining the coupling between amountCents and the splitType, including the requirement to resend splits for non-equal types. It says nothing about categoryToken null-clearing or balanceCurrency behavior, leaving those to the schema.

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?

The first sentence gives a clear verb+resource: it changes an existing expense, which distinguishes it from add_expense, delete_expense and update_payment. It does not name a sibling alternative (bulk_edit_expenses for many at once), so the differentiation is inferred from the verb 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?

The description establishes the precondition workflow: read the record with get_transaction first to obtain lockVersion, then send only changed fields, and re-read if the revision is stale. It does not explicitly exclude bulk_edit_expenses for multi-record edits or update_payment for payment rows, so exclusions are left implicit.

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