Skip to main content
Glama

Add an expense

add_expense

Record something one person paid for the group. Split equally by default; pass split_between for a subset, or shares for an uneven split. One expense covers one set of people — a receipt whose items aren't all shared by everyone is several expenses, so call this once per group of items that the same people share, rather than splitting the total equally. Works on simple, accountless splits. Secure splits (created by a signed-in user) are read-only here and must be opened in a browser.

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": {
      "split": "<split>",
      "amount": "<amount>",
      "paid_by": "<paid_by>"
    },
    "name": "add_expense"
  }
}

Input Schema

NameRequiredDescriptionDefault
dateNoDate as YYYY-MM-DD. Defaults to today.
splitYesThe split key, or the whole https://split.xuper.fun/k/<key> link.
amountYesAmount in the split's currency, as a decimal (e.g. 249.50).
sharesNoUneven split. Either an exact `amount` per person (must add up to the total) or a relative `weight` per person (e.g. weight 2 for a couple). Don't combine with split_between.
paid_byYesWho paid — a participant's name (or id) in this split. A card receipt rarely names the payer, so ask unless you know: guess wrong and every balance points the wrong way. If the user counts themselves among the participants, assume it was them and say that you assumed it — what you must not do is pick a payer silently.
descriptionNoWhat it was, e.g. "Groceries".
split_betweenNoNames of the people sharing this cost, split equally. Defaults to everyone.

Output Schema

NameRequiredDescriptionDefault
keyYes
urlYes
titleYes
secureYes
entriesYes
settledYes
currencyYes
created_atYes
settlementYes
total_spentYes
participantsYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changed
    • removedOutput schema / properties / entries / items / properties / description / anyOf
      Removed value: -[
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • addedOutput schema / properties / entries / items / properties / description / type
      Added value: +[
      +  "string",
      +  "null"
      +]
    • removedOutput schema / properties / entries / items / properties / to / anyOf
      Removed value: -[
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • addedOutput schema / properties / entries / items / properties / to / type
      Added value: +[
      +  "string",
      +  "null"
      +]
  2. Changed1 schema field changed
    • changedInput schema / properties / paid_by / description
      Previous value: -"Who paid — a participant's name (or id) in this split."New value: +"Who paid — a participant's name (or id) in this split. A card receipt rarely names the payer, so ask unless you know: guess wrong and every balance points the wrong way. If the user counts themselves among the participants, assume it was them and say that you assumed it — what you must not do is pick a payer silently."
  3. First observed

TDQS

A4.3/5.0
Behavior4/5

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

Beyond the readOnlyHint=false/destructiveHint=false annotations, the description discloses a real scope constraint — secure splits created by a signed-in user are read-only via this tool — and gives behavioral guidance on payer selection (assume the user if they're a participant, but never pick silently). It does not cover reversibility or what happens on a duplicate call, though delete_entry/update_entry exist as siblings.

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?

Four dense sentences, front-loaded with the core action and split-mode routing before the multi-expense caveat and the secure-split limitation. Every sentence carries distinct decision-relevant information with no restatement of the schema.

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?

With an output schema present and full schema description coverage, the description needn't explain return values, and it covers the main risk areas: how many calls to make, which split mode to choose, payer ambiguity, and the accountless-vs-secure boundary. The remaining gap is the expense-vs-payment distinction relative to record_payment, which an agent must infer from the sibling list.

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 baseline is 3; the description goes further by explaining the relationship between parameters — shares is for uneven splits, split_between for equal subsets, and the two must not be combined. The mutual-exclusivity rule and the "defaults to everyone / equal split" semantics are genuine value beyond the schema text.

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?

States a concrete verb and resource — "Record something one person paid for the group" — which unambiguously identifies an expense-creation tool. It implicitly separates itself from create_split and add_participant by framing the unit as one person's payment for a group. It never explicitly distinguishes an expense from a settlement payment, so the boundary with the sibling record_payment must be inferred.

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 prescribes when to call once vs. multiple times ("a receipt whose items aren't all shared by everyone is several expenses... call this once per group of items") and names the three split modes with the condition that selects each (default equal, split_between for a subset, shares for uneven). It also states a hard exclusion: secure splits are read-only here and must be opened in a browser.

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.