group_expenses
Group an exact set of recorded expenses for a client, project, trip, job, or other user-named purpose. Examples: 'group my Mexico meals for client Rob', 'put these Vegas expenses under the Vegas project', or 'group these for client Rob and create a report'. The user does not need to know about tags: ExpenseBot resolves the requested name against existing groups and proposes creating one only when needed. Use exact expenseId values returned by search_expenses. A grounded preview is automatic for every bulk request; the user does not need to ask for one. First call with confirm omitted/false, show the returned 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. When the request includes a report, set createReport:true on that confirmed group_expenses call and use its report result; do not run a separate broader create_report query. For 'without personal expenses', set excludePersonal:true; ExpenseBot removes Personal-tagged and Personal-category rows before preview so their Personal marker is never overwritten. The confirmed operation returns exact report and Bill Client links. Expenses already assigned to another ordinary report are excluded; if none remain, no duplicate report is created and the result links to Reports instead. Keep the user-facing response concise and do not add unsolicited tax or substantiation advice. Do not call check_compliance, get_report_details, or tax/deductibility tools before or after this workflow unless the user explicitly asks for that separate analysis. 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 it against the preview. A returned Bill Client URL opens the reviewed billing handoff and 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. |