sw_create_expense
Creates a Splitwise expense with equal or custom per-person splits, an optional receipt, and a confirmation preview before charges are posted.
Instructions
Create a Splitwise expense. Splits: split_equally:true (you paid, everyone in the group owes an equal part); split:"equal" with paid_by (someone — e.g. the other parent — paid, split equally among split_among or the whole group); or a users array for custom per-person splits (paid_share and owed_share as decimal strings like "25.00"). cost must be a decimal string. Pass category by name (or category_id); with neither, the most common category of similar expenses in the group is used and shown in the preview as inferred_category. The preview also lists possible_duplicates — expenses in the group, live or deleted, with the same cost, a similar description and a date within a day; check them before confirming. Pass receipt to attach an image or PDF in the same call. This puts charges on every participant's balance and notifies them. In sw_batch it produces expense_id. Asks the user to confirm first: a confirmation prompt where the client supports one; otherwise the first call returns a preview and a confirmToken, and only a repeat call with that token proceeds (see MCP_CONFIRM_MODE).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cost | Yes | Total cost as decimal string, e.g. "25.00" | |
| date | No | ISO 8601 datetime | |
| split | No | "equal": paid_by paid the whole cost and everyone in split_among owes an equal part (odd cents go to the first participants). Use instead of split_equally (which always makes YOU the payer) or users. | |
| users | No | Custom split (mutually exclusive with split_equally). Full list of participants required. | |
| details | No | Notes | |
| paid_by | No | With split:"equal" — who paid: a user id, or a group member's name or email | |
| receipt | No | Receipt to attach: PNG, JPEG, GIF or PDF, up to 10 MiB. Give exactly one of upload_id, path or base64. The type is detected from the file contents. Replaces any receipt already on the expense. | |
| category | No | Category by name, e.g. "Education" or "Medical expenses" (any case). Mutually exclusive with category_id. Omit both and the most common category of similar expenses in the group is used. | |
| group_id | Yes | Group to add expense to (use 0 for no group) | |
| category_id | No | Category id from sw_get_categories | |
| description | Yes | Short description of the expense | |
| split_among | No | With split:"equal" — who shares the cost (ids, names or emails). Default: every group member. | |
| confirmToken | No | ONLY for the two-step confirmation fallback (a client without MCP elicitation). The confirmToken from this same tool's phase-1 "confirmation-required" response, passed back ONLY after the user has seen that preview and explicitly approved it in chat — never on the first call, never invented, never reused. Call again with the same arguments. Ignored when the client supports elicitation. | |
| currency_code | No | Currency code, e.g. "USD". Defaults to group/user default. | |
| split_equally | No | Split equally among group members (mutually exclusive with users) |