group_expenses
Group exact expenses for a user-named client/project/trip/job, with an optional report. Reuse existing groups; propose new only if needed. Full expenseIds from search_expenses. Preserve assignments unless explicitly replacing (replaceExistingTags:true). First call previews even with early confirm:true: show rows, count, totals, group, exclusions/conflicts; ask approval once, then repeat identical operationId/selection with confirm:true. Group-and-report: createReport:true on confirmation; never a separate broader create_report query. excludePersonal:true removes Personal-tagged and Personal-category rows before preview, preserving markers. Skip rows on other ordinary reports; no matches: no duplicate, link to Reports. Exact report/Bill Client links. Say group, not tag. Preview totals are provisional; use terminal count/total/currency. Bill Client opens a reviewed flow, not a created/sent/confirmed invoice. Sharing requires share_report recipient confirmation. No unsolicited tax/substantiation advice or check_compliance/get_report_details/tax calls unless explicitly requested.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"operationId": "<operationId>"
},
"name": "group_expenses"
}
}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 keeps existing assignments; true only after the user explicitly asks to replace; preview shows both. |
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 |