Skip to main content
Glama

wariwari

Add an expense

add_expense

Use this to record an expense. amountCents is in minor units of currency (¥1,000 is 1000, $12.50 is 1250). paidByParticipantToken is who paid; splits lists who shares it. For an even split use splitType equal and omit amountCents from the splits. Take participant tokens from get_group or search, and default the date to today.

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>",
      "description": "<description>",
      "amountCents": "<amountCents>",
      "currency": "<currency>",
      "splitType": "<splitType>",
      "date": "<date>",
      "paidByParticipantToken": "<paidByParticipantToken>",
      "splits": "<splits>"
    },
    "name": "add_expense"
  }
}

Input Schema

NameRequiredDescriptionDefault
dateYesThe day it was paid, `YYYY-MM-DD`.
splitsYesWho shares the expense. 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).
currencyYesThe currency it was paid in. One other than the group's is converted into the group currency at the rate on `date`.
splitTypeYesHow 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 for the time it is recorded, in Japan time.
groupTokenYesThe group's token, from `listGroups` or `listSearchResults`.
amountCentsYesThe total in minor units of `currency` (¥1,000 is 1000, $12.50 is 1250).
descriptionYesWhat the expense was for, as the group will see it.
categoryTokenNoThe group category to file it under, by token from `showGroup`. Omit for none.
idempotencyKeyNoA UUID you make up for this call. If the call fails or gets no answer and you try again, send the same UUID so nothing is added twice. Use a new one for each new thing you add.
balanceCurrencyNoCurrency bucket used for balances. Omit to use the group currency; send the transaction currency to keep this transaction in a separate original-currency balance bucket.
paidByParticipantTokenYesThe member who paid, by token from `showGroup`.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed23 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 / categoryToken / $ref
      Removed value: -"#/$defs/Token"
    • addedInput schema / properties / categoryToken / allOf
      Added value: +[
      +  {
      +    "$ref": "#/$defs/Token"
      +  }
      +]
    • addedInput schema / properties / categoryToken / description
      Added value: +"The group category to file it under, by token from `showGroup`. Omit for none."
    • 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: +"The currency it was paid in. One other than the group's is converted into\nthe group currency at the rate on `date`.\n"
    • addedInput schema / properties / date / description
      Added value: +"The day it was paid, `YYYY-MM-DD`."
    • 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`."
    • 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. For `equal`, list the members and omit `amountCents`:\nthe server divides the total, odd cents to the first members in the group's\norder. For `amount`, `percentage` and `shares`, give each member's\n`amountCents`; they must add up to the total (exactly for `amount`, otherwise\nwithin 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 for the time it is recorded, in Japan time."
  2. Changed18 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: +{
      +  "$ref": "#/$defs/Token"
      +}
    • removedInput schema / properties / groupCategoryToken
      Removed value: -{
      -  "$ref": "#/$defs/Token"
      -}
    • addedInput schema / properties / groupToken / description
      Added value: +"The group's token, from `listGroups` or `listSearchResults`."
    • addedInput schema / properties / idempotencyKey
      Added value: +{
      +  "description": "A UUID you make up for this call. If the call fails or gets no answer and you try again, send the same UUID so nothing is added twice. Use a new one for each new thing you add.",
      +  "format": "uuid",
      +  "type": "string"
      +}
    • removedInput schema / properties / kind
      Removed value: -{
      -  "allOf": [
      -    {
      -      "$ref": "#/$defs/TransactionKind"
      -    }
      -  ],
      -  "default": "expense",
      -  "description": "Defaults to `expense`; use `payment` for settlement payments.",
      -  "example": "expense"
      -}
    • 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: -"`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"
    • 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"
    • changedInput schema / required
      Previous value: -[
      -  "groupToken",
      -  "description",
      -  "amountCents",
      -  "currency",
      -  "splitType",
      -  "date",
      -  "paidByToken",
      -  "splits"
      -]New value: +[
      +  "groupToken",
      +  "description",
      +  "amountCents",
      +  "currency",
      +  "splitType",
      +  "date",
      +  "paidByParticipantToken",
      +  "splits"
      +]
  3. First observed

TDQS

A3.6/5.0
Behavior3/5

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

The annotations already declare readOnlyHint=false, destructiveHint=false and openWorldHint=false, so the safety profile is covered. The description adds operational context beyond that: minor-unit amounts, how splits are interpreted, and the today-by-default date rule. However, it says nothing about what happens on success or failure, permission requirements, or the duplicate-protection behavior (idempotency) that the schema documents but the narrative omits.

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?

Four short sentences, front-loaded with the action, then the two semantics traps (units, payer/splits), then prerequisites. No filler. It could tighten the repeated restatement of amountCents units, but nothing is wasted enough to hurt.

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 12-parameter create tool, the narrative covers the highest-risk semantics: currency units, split modes, participant token sourcing and the date default. Optional and edge parameters (balanceCurrency, categoryToken, idempotencyKey, timeOfDay) are left entirely to the schema, which documents them fully, so this is adequate rather than exhaustive.

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 100%, including per-property text for amountCents, splits, splitType, currency and date, so the baseline is 3. The description restates the minor-unit convention and the equal-split rule (omit per-split amountCents) but adds little that the schema does not already say, aside from the 'default date to today' guidance.

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 description opens with a concrete verb and resource: record an expense. It immediately frames the write operation and the key concepts (payer, splits), which lets an agent distinguish it from read-side siblings like get_expense_history or get_transaction. It stops short of naming a near-neighbor such as update_expense or duplicate_group-style alternatives.

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?

'Take participant tokens from get_group or search' and 'default the date to today' give concrete pre-call steps and safe defaults, which is genuinely actionable. It does not state when to choose this over update_expense or create_recurring_expense, but the create versus update boundary is reasonably implied by 'record'.

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