Add an expense to XMemo
add_expenseRecord an expense by specifying item, amount, and optional details like currency, category, and merchant. Automatically captures transaction date for accurate ledger tracking.
Instructions
Record one expense in the XMemo Ledger. Call this whenever the user states a concrete expense, purchase, income, or refund — for example, 'I spent 25 on lunch' or 'log this expense' — not only on an explicit 'record this'. Capture date, amount, currency, item, and merchant/category when present.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| item | Yes | The purchased item or service, for example 2 watermelons or Nintendo Switch 2. | |
| note | No | Optional completion note. | |
| path | No | A simple user-facing category or path for this memory, such as preferences, projects/xmemo, or personal/travel. | finance/ledger/expenses |
| scope | No | Optional scope that narrows memory access; leave blank for the token default. | |
| amount | Yes | Positive transaction amount as a number. | |
| bucket | No | Memory bucket or namespace to read from or write to; use % only for tools that support wildcard reads. | private |
| team_id | No | Optional team/workspace identifier for team-scoped memory access. | |
| agent_id | No | Optional client-supplied agent label for memory attribution. | |
| category | No | Optional spending category, such as food, transport, or electronics. | |
| currency | No | Currency code or label, such as CNY, RMB, JPY, yen, or USD. For ledger search/list tools, leave blank unless the user explicitly requested one currency; labels are normalized to codes. | CNY |
| merchant | No | Optional merchant or store name. | |
| device_id | No | Optional client-supplied device identifier for attribution. | |
| device_label | No | Optional human-readable device label for attribution. | |
| payment_method | No | Optional payment method, such as card, cash, Alipay, or WeChat Pay. | |
| transaction_date | No | Transaction date in YYYY-MM-DD. Leave blank to use today's UTC date. | |
| agent_instance_id | No | Optional stable, non-secret agent instance ID for per-client attribution. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |