Skip to main content
Glama
trustxai

amazing-splitwise-mcp

by trustxai

splitwise_create_expense

Create a Splitwise expense with exactly one split mode—equal, explicit shares, or equal split between users—and validate that shares sum to the cost before sending.

Instructions

Create an expense with exactly one split mode; the shares are checked locally before sending.

Calls POST /create_expense. Refused with Error: … writes are disabled unless SPLITWISE_ALLOW_WRITES=1 (the server's client enforces it; this tool never bypasses it). Undo with splitwise_delete_expense. NOT idempotent: every successful call creates a new expense — never retry blindly after a timeout; list first.

Pick EXACTLY ONE split mode:

  • A split_equally: true — a GROUP expense (group_id > 0) that YOU paid, split equally among all group members by Splitwise.

  • B shares: [...] — explicit shares, one per participant (≥ 2), each with user_id OR email+first_name+last_name, a paid_share and an owed_share (2-decimal strings). Σ paid_share and Σ owed_share must each equal cost.

  • C equal_split_between: [user ids] — equal split between these people (≥ 2, INCLUDING the payer). The payer is paid_by_user_id, or you when omitted (one GET /get_current_user). Owed shares are cost / n rounded down to the cent; the leftover cents go on the payer so the sums close (10.00 / 3 → 3.34 payer, 3.33, 3.33).

Shares that do not add up are refused with an error naming the mismatch BEFORE any request. Shares are sent flattened as users__{i}__user_id|email|first_name|last_name| paid_share|owed_share. Money is a 2-decimal string, never a float.

When to Use:

  • "Add 90.00 for dinner in the Cusco group, split equally" (mode A).

  • "I paid 30.00 for a taxi with Ana and Luis, split three ways" (mode C).

  • "Ana paid 50.00; I owe 20.00 of it and she owes 30.00" (mode B).

When NOT to Use:

  • To change an existing expense (use splitwise_update_expense).

  • To find a friend's, group's or category's id by name (use splitwise_resolve_friend, splitwise_resolve_group, splitwise_resolve_category first).

  • To comment on an expense (use splitwise_create_comment).

Returns: A confirmation echoing Splitwise's response: the literal errors value (empty {} means accepted), and per returned expense its id, description, cost, group, date and the shares exactly as Splitwise stored them.

Examples:

  • params = {"cost": "90.00", "description": "Dinner", "group_id": 12345, "split_equally": true}

  • params = {"cost": "30.00", "description": "Taxi", "equal_split_between": [491923, 678, 910]}

  • params = {"cost": "50.00", "description": "Groceries", "currency_code": "PEN", "shares": [ {"user_id": 678, "paid_share": "50.00", "owed_share": "30.00"}, {"user_id": 491923, "paid_share": "0.00", "owed_share": "20.00"}]}

Error Handling: Local refusals (no request made): more or fewer than one split mode, shares that do not sum to cost, a share with both or neither identity, duplicate participants, split_equally without a group, a payer missing from equal_split_between. Splitwise answers 200 even when it rejects an expense — the client turns a non-empty errors into Error: Splitwise rejected the request…; if that body still carried an expense object the error adds "Splitwise still returned N expense object(s) … may have landed" with the ids, so read back before retrying. On a timeout or 5xx the outcome is UNKNOWN: check splitwise_get_expenses before retrying.

Input Schema

NameRequiredDescriptionDefault
paramsYes

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.9/5.0
Behavior5/5

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

Annotations already declare readOnly=false, idempotent=false, destructive=false, and openWorld=true. The description goes well beyond those by disclosing the SPLITWISE_ALLOW_WRITES=1 gate, local pre-send validation, non-idempotency and the warning never to retry blindly after a timeout, the fact that Splitwise returns HTTP 200 even on rejection, unknown outcome on timeout/5xx, and read-back guidance. These are exactly the behavioral traits annotations cannot express.

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?

It is front-loaded with the core purpose and critical constraints, then cleanly organized into split-mode definitions, When to Use / When NOT to Use, Returns, Examples, and Error Handling. It is nevertheless verbose: the Returns section duplicates information likely available in the output schema, and lines about the REST endpoint and flattened payload formatting are not strictly necessary for an agent invoking the tool.

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?

Given the tool's complexity (three split modes, write gating, non-idempotency, timeout ambiguity) and the available annotations and output schema, the description is complete. It covers prerequisites, sibling alternatives, concrete parameter examples, and failure modes, leaving no material gap for correct invocation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The description explains the three mutually exclusive split modes (A, B, C), identity requirements (user_id or email+first_name+last_name), the requirement that sum paid_share and sum owed_share each equal cost, the mode C rounding rule with a worked example, and the 2-decimal money-string format. This adds mode-selection semantics and validation rules that go beyond the nested schema's per-field descriptions.

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?

The description opens with a specific verb and resource ('Create an expense') and immediately states the critical constraint of exactly one split mode. It names sibling alternatives for update, deletion, id resolution, and commenting, so an agent can distinguish it from every neighboring tool without opening other schemas.

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?

It contains explicit 'When to Use' scenarios and a 'When NOT to Use' section with named alternatives: update_expense, resolve_friend, resolve_group, resolve_category, and create_comment. This leaves no inference required about when this tool is the right selection.

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