group_expenses
Group an exact set of recorded expenses for a client, project, trip, job, or other user-named purpose, e.g. 'group my Mexico meals for client Rob' or 'group these for client Rob and create a report'. The user need not know about tags: ExpenseBot resolves the name against existing groups and proposes creating one only when needed. Use exact expenseId values from search_expenses. Existing assignments are preserved by default; set replaceExistingTags:true only for an explicit replacement request. A grounded preview is automatic for every bulk request. First call with confirm omitted/false, show the exact rows, count, totals, proposed group, exclusions and conflicts, then ask for approval. Only after explicit user approval, repeat the same operationId and selection with confirm:true (a premature confirm:true is converted to preview). If the request includes a report, set createReport:true on that confirmed call and use its report result; do not run a separate broader create_report query. For 'without personal expenses' set excludePersonal:true; Personal-tagged and Personal-category rows are removed before preview so their marker is never overwritten. The confirmed operation returns exact report and Bill Client links. Expenses already on another ordinary report are excluded; if none remain, no duplicate report is created and the result links to Reports. Keep the response concise, with no unsolicited tax or substantiation advice; do not call check_compliance, get_report_details or tax/deductibility tools around this workflow unless the user asks. In user-facing prose call the destination a group, not a tag. Treat preview totals as provisional; after confirmation use only the terminal result's exact count, total and currency without reconciling to the preview. A Bill Client URL opens the reviewed billing handoff; it does not mean an invoice was created, sent, or confirmed. Sharing remains a separate share_report action with recipient confirmation.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| undo | No | Undo a completed grouping within its undo window. | |
| group | No | The user-named destination group to apply to every eligible selected expense. | |
| status | No | Read operation status using operationId. | |
| confirm | No | Omit/false for preview; true only after explicit approval. | |
| selection | No | Exact expenses returned by search_expenses and approved for this bounded operation. | |
| operationId | Yes | Stable idempotency key generated once for the preview and reused unchanged. | |
| reportTitle | No | Optional title when createReport is true; otherwise ExpenseBot derives one from the group. | |
| createReport | No | Create a report from the exact eligible grouped expenses. | |
| excludedTags | No | Existing groups to exclude before preview and grouping. | |
| approveNewGroup | No | True only when the preview says a new group is required. | |
| excludePersonal | No | Exclude Personal-tagged and Personal-category expenses from both grouping and the exact report. | |
| excludedCategories | No | Expense categories to exclude before preview and grouping. | |
| replaceExistingTags | No | Default false preserves existing assignments. True only after the user explicitly requests replacement; preview shows existing and proposed tags. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| undo | No | ||
| group | No | ||
| report | No | ||
| status | Yes | ||
| message | No | ||
| preview | No | ||
| success | Yes | ||
| manifest | No | ||
| candidates | No | ||
| exclusions | No | ||
| reportsUrl | No | ||
| finalAnswer | No | ||
| operationId | No | ||
| confirmation | No | ||
| suggestedTag | No | ||
| creationStatus | No | ||
| responseGuidance | No | ||
| reviewExpensesUrl | No | ||
| requiresConfirmation | No | ||
| requiresNewGroupApproval | No |