Skip to main content
Glama

group_expenses

Destructive

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

NameRequiredDescriptionDefault
undoNoUndo a completed grouping within its undo window.
groupNoThe user-named destination group to apply to every eligible selected expense.
statusNoRead operation status using operationId.
confirmNoOmit/false for preview; true only after explicit approval.
selectionNoExact expenses returned by search_expenses and approved for this bounded operation.
operationIdYesStable idempotency key generated once for the preview and reused unchanged.
reportTitleNoOptional title when createReport is true; otherwise ExpenseBot derives one from the group.
createReportNoCreate a report from the exact eligible grouped expenses.
excludedTagsNoExisting groups to exclude before preview and grouping.
approveNewGroupNoTrue only when the preview says a new group is required.
excludePersonalNoExclude Personal-tagged and Personal-category expenses from both grouping and the exact report.
excludedCategoriesNoExpense categories to exclude before preview and grouping.
replaceExistingTagsNoDefault false keeps existing assignments; true only after the user explicitly asks to replace; preview shows both.

Output Schema

NameRequiredDescriptionDefault
undoNo
groupNo
reportNo
statusYes
messageNo
previewNo
successYes
manifestNo
candidatesNo
exclusionsNo
reportsUrlNo
finalAnswerNo
operationIdNo
confirmationNo
suggestedTagNo
creationStatusNo
responseGuidanceNo
reviewExpensesUrlNo
requiresConfirmationNo
requiresNewGroupApprovalNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed8 schema fields changed
    • removedOutput schema / properties / candidates / items / additionalProperties
      Removed value: -true
    • removedOutput schema / properties / confirmation / additionalProperties
      Removed value: -true
    • removedOutput schema / properties / exclusions / additionalProperties
      Removed value: -true
    • removedOutput schema / properties / group / additionalProperties
      Removed value: -true
    • removedOutput schema / properties / manifest / additionalProperties
      Removed value: -true
    • removedOutput schema / properties / preview / additionalProperties
      Removed value: -true
    • removedOutput schema / properties / report / additionalProperties
      Removed value: -true
    • removedOutput schema / properties / undo / additionalProperties
      Removed value: -true
  2. Changed1 schema field changed
    • changedInput schema / properties / replaceExistingTags / description
      Previous value: -"Default false preserves existing assignments. True only after the user explicitly requests replacement; preview shows existing and proposed tags."New value: +"Default false keeps existing assignments; true only after the user explicitly asks to replace; preview shows both."
  3. Changed2 schema fields changed
    • addedInput schema / properties / selection / properties / items / items / properties / expected / properties / city
      Added value: +{
      +  "description": "Recorded location from the reviewed selection.",
      +  "type": "string"
      +}
    • addedInput schema / properties / selection / properties / items / items / properties / expected / properties / date
      Added value: +{
      +  "description": "Recorded YYYY-MM-DD from the reviewed selection.",
      +  "type": "string"
      +}
  4. Changed1 schema field changed
    • addedInput schema / properties / replaceExistingTags
      Added value: +{
      +  "description": "Default false preserves existing assignments. True only after the user explicitly requests replacement; preview shows existing and proposed tags.",
      +  "type": "boolean"
      +}
  5. Changed1 schema field changed
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "additionalProperties": true,
      +  "properties": {
      +    "candidates": {
      +      "items": {
      +        "additionalProperties": true,
      +        "type": "object"
      +      },
      +      "type": "array"
      +    },
      +    "confirmation": {
      +      "additionalProperties": true,
      +      "type": "object"
      +    },
      +    "creationStatus": {
      +      "type": "string"
      +    },
      +    "exclusions": {
      +      "additionalProperties": true,
      +      "type": "object"
      +    },
      +    "finalAnswer": {
      +      "type": "string"
      +    },
      +    "group": {
      +      "additionalProperties": true,
      +      "type": "object"
      +    },
      +    "manifest": {
      +      "additionalProperties": true,
      +      "type": "object"
      +    },
      +    "message": {
      +      "type": "string"
      +    },
      +    "operationId": {
      +      "type": "string"
      +    },
      +    "preview": {
      +      "additionalProperties": true,
      +      "type": "object"
      +    },
      +    "report": {
      +      "additionalProperties": true,
      +      "type": "object"
      +    },
      +    "reportsUrl": {
      +      "type": "string"
      +    },
      +    "requiresConfirmation": {
      +      "type": "boolean"
      +    },
      +    "requiresNewGroupApproval": {
      +      "type": "boolean"
      +    },
      +    "responseGuidance": {
      +      "type": "string"
      +    },
      +    "reviewExpensesUrl": {
      +      "type": "string"
      +    },
      +    "status": {
      +      "type": "string"
      +    },
      +    "success": {
      +      "type": "boolean"
      +    },
      +    "suggestedTag": {
      +      "type": "string"
      +    },
      +    "undo": {
      +      "additionalProperties": true,
      +      "type": "object"
      +    }
      +  },
      +  "required": [
      +    "success",
      +    "status"
      +  ],
      +  "type": "object"
      +}
  6. Changed1 schema field changed
    • changedOutput schema / (root)
      Previous value: -{
      -  "additionalProperties": true,
      -  "description": "Standard ExpenseBot tool result envelope. `message` is the human-readable summary the AI cites; `data` is the structured payload (totals, breakdowns, ids, etc.). On failure, `success` is false and `error` carries a code/message/hint triple.",
      -  "properties": {
      -    "data": {
      -      "additionalProperties": true,
      -      "description": "Structured payload. Shape varies per tool — common keys: total, breakdown, comparison, sampleMeta, ids, expenseId, reportId, signupUrl, results.",
      -      "type": "object"
      -    },
      -    "error": {
      -      "additionalProperties": true,
      -      "description": "Present only when success === false.",
      -      "properties": {
      -        "code": {
      -          "type": "string"
      -        },
      -        "hint": {
      -          "type": "string"
      -        },
      -        "message": {
      -          "type": "string"
      -        }
      -      },
      -      "type": "object"
      -    },
      -    "message": {
      -      "description": "Human-readable result text. Always present on success; prefer rendering this verbatim before any further reasoning.",
      -      "type": "string"
      -    },
      -    "sampleMeta": {
      -      "additionalProperties": true,
      -      "description": "Set when the underlying dataset was truncated. isTruncated=true means the agent saw a sample of `sampleCount` of `totalCount` rows; aggregate totals are still accurate.",
      -      "properties": {
      -        "isTruncated": {
      -          "type": "boolean"
      -        },
      -        "sampleCount": {
      -          "type": "integer"
      -        },
      -        "totalCount": {
      -          "type": "integer"
      -        }
      -      },
      -      "type": "object"
      -    },
      -    "success": {
      -      "description": "False on tool errors; check before reading `data`.",
      -      "type": "boolean"
      -    }
      -  },
      -  "type": "object"
      -}New value: +null
  7. Changed7 schema fields changed
    • addedInput schema / properties / group / description
      Added value: +"The user-named destination group to apply to every eligible selected expense."
    • addedInput schema / properties / group / properties / kind / description
      Added value: +"How to label the destination in user-facing confirmation text."
    • addedInput schema / properties / reportTitle / description
      Added value: +"Optional title when createReport is true; otherwise ExpenseBot derives one from the group."
    • addedInput schema / properties / selection / description
      Added value: +"Exact expenses returned by search_expenses and approved for this bounded operation."
    • addedInput schema / properties / selection / properties / items / description
      Added value: +"One exact receipt identity per selected expense; never broaden this list after preview."
    • addedInput schema / properties / selection / properties / items / items / properties / expected / description
      Added value: +"Optional current state copied from search results for conflict detection."
    • addedInput schema / properties / selection / properties / items / items / properties / expected / properties / tag / description
      Added value: +"Current group/tag value observed before preview; an empty string means ungrouped."
  8. First observed

TDQS

A4.7/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations only flag it as a destructive, open-world write; the description adds the real behavior an agent needs — first call always previews even with early confirm:true, approval must be asked once, then the identical operationId/selection is repeated, preview totals are provisional versus terminal counts, and undo exists within a window. It also discloses that Bill Client opens a reviewed flow rather than a created invoice and that sharing needs recipient confirmation.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Extremely information-dense and front-loaded with the core grouping scope, but the back half degenerates into telegraphic fragments ('Skip rows on other ordinary reports; no matches: no duplicate, link to Reports.', 'Exact report/Bill Client links. Say group, not tag.') that lack connective structure and slow parsing.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 13-parameter, nested-object mutation with an output schema, the description covers the preview/confirm workflow, idempotency key reuse, exclusion semantics, conflict handling, and the downstream report/Bill Client behavior — everything needed to invoke and sequence the call correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 100% schema coverage the schema already documents params, but the description adds decision-level meaning: replaceExistingTags defaults to preserving assignments unless explicitly replacing, excludePersonal strips Personal-tagged and Personal-category rows before preview while preserving markers, and createReport must ride on the same confirmation. Less consequential params (undo, status, approveNewGroup, excludedTags/excludedCategories) are left to the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource ('Group exact expenses for a user-named client/project/trip/job, with an optional report') and explicitly scopes input to 'Full expenseIds from search_expenses', which separates it from the search and create_report siblings.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives explicit routing rules: reuse existing groups and propose new ones only when needed, use createReport:true on confirmation rather than 'a separate broader create_report query', skip rows already on other ordinary reports, and do not call check_compliance/get_report_details/tax unless requested. When-to-use and when-not-to-use are both covered.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.