Skip to main content
Glama

correct_expenses

Destructive

Preview and correct category, business purpose or user-supplied attendees on one or more exact expenses; first search_expenses for full expenseIds. Automatic preview with confirm omitted/false: show exact count and before/after changes, ask approval once, then repeat identical operationId/selection/change with confirm:true; early confirm returns preview. Never infer attendee names/business context. attendeeMode add preserves existing attendees; replace changes only that Notes segment. Preserve card, description, inbox and other structured Notes segments; skip Formula Notes/overflow. Terminal result gives applied/conflicted/failed counts, status and Undo. Does not omit duplicates, change amounts/dates or do broad Calendar matching; omit/restore via omit_expenses; one row's merchant or tag: update_expense. Mixed (e.g. category plus attendees), unsupported or over-100-row cleanup: https://www.expensebot.ai/review-expenses?source=mcp.

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": "correct_expenses"
  }
}

Input Schema

NameRequiredDescriptionDefault
undoNoUndo within the Undo window.
changeNoExactly one correction; its type selects the required value field.
statusNoRead status by operationId.
confirmNoOmit/false for preview; true only after explicit approval.
selectionNoExact expenses from search_expenses approved for this correction.
operationIdYesIdempotency key generated once and reused unchanged.

Output Schema

NameRequiredDescriptionDefault
undoNo
changeNo
statusYes
messageNo
previewNo
successYes
manifestNo
finalAnswerNo
operationIdNo
confirmationNo
responseGuidanceNo
reviewExpensesUrlNo
requiresConfirmationNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed5 schema fields changed
    • removedOutput schema / properties / change / additionalProperties
      Removed value: -true
    • removedOutput schema / properties / confirmation / additionalProperties
      Removed value: -true
    • removedOutput schema / properties / manifest / additionalProperties
      Removed value: -true
    • removedOutput schema / properties / preview / additionalProperties
      Removed value: -true
    • removedOutput schema / properties / undo / additionalProperties
      Removed value: -true
  2. Changed15 schema fields changed
    • changedInput schema / properties / change / description
      Previous value: -"Exactly one correction. The selected type determines which matching value field is required."New value: +"Exactly one correction; its type selects the required value field."
    • changedInput schema / properties / change / properties / attendeeMode / description
      Previous value: -"Use add unless the user explicitly asks to replace existing attendees."New value: +"add unless the user asks to replace existing attendees."
    • changedInput schema / properties / change / properties / attendees / description
      Previous value: -"Attendee names explicitly supplied by the user when type is attendees; never infer names."New value: +"Names the user supplied when type is attendees; never infer names."
    • changedInput schema / properties / change / properties / businessPurpose / description
      Previous value: -"User-supplied business purpose to apply when type is businessPurpose."New value: +"User-supplied purpose when type is businessPurpose."
    • changedInput schema / properties / change / properties / category / description
      Previous value: -"Configured expense category to apply when type is category."New value: +"Configured category when type is category."
    • changedInput schema / properties / change / properties / type / description
      Previous value: -"The one correction kind to apply to every exact selected expense."New value: +"Correction kind applied to every selected expense."
    • changedInput schema / properties / operationId / description
      Previous value: -"Stable idempotency key generated once for preview and reused unchanged."New value: +"Idempotency key generated once and reused unchanged."
    • changedInput schema / properties / selection / description
      Previous value: -"Exact expenses returned by search_expenses and approved for this bounded correction."New value: +"Exact expenses from search_expenses approved for this correction."
    • changedInput schema / properties / selection / properties / items / description
      Previous value: -"One exact receipt identity per selected expense; never broaden this list after preview."New value: +"One receipt identity per expense; never broaden after preview."
    • changedInput schema / properties / selection / properties / items / items / properties / expected / description
      Previous value: -"Optional optimistic-concurrency values copied from the search result."New value: +"Optional search values for conflict detection."
    • changedInput schema / properties / selection / properties / items / items / properties / expected / properties / category / description
      Previous value: -"Current category observed before preview for conflict detection."New value: +"Category seen before preview."
    • changedInput schema / properties / selection / properties / items / items / properties / expected / properties / notes / description
      Previous value: -"Current structured Notes value observed before preview for conflict detection."New value: +"Notes value seen before preview."
    • changedInput schema / properties / selection / properties / items / items / properties / receiptId / description
      Previous value: -"Exact full expenseId/Column-Q receipt identity from search_expenses."New value: +"Full expenseId (Column Q) from search_expenses."
    • changedInput schema / properties / status / description
      Previous value: -"Read operation status using operationId."New value: +"Read status by operationId."
    • changedInput schema / properties / undo / description
      Previous value: -"Undo a completed correction within its Undo window."New value: +"Undo within the Undo window."
  3. Changed2 schema fields changed
    • addedInput schema / properties / change / oneOf
      Added value: +[
      +  {
      +    "properties": {
      +      "type": {
      +        "const": "category"
      +      }
      +    },
      +    "required": [
      +      "category"
      +    ]
      +  },
      +  {
      +    "properties": {
      +      "type": {
      +        "const": "businessPurpose"
      +      }
      +    },
      +    "required": [
      +      "businessPurpose"
      +    ]
      +  },
      +  {
      +    "properties": {
      +      "type": {
      +        "const": "attendees"
      +      }
      +    },
      +    "required": [
      +      "attendees"
      +    ]
      +  }
      +]
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "additionalProperties": true,
      +  "properties": {
      +    "change": {
      +      "additionalProperties": true,
      +      "type": "object"
      +    },
      +    "confirmation": {
      +      "additionalProperties": true,
      +      "type": "object"
      +    },
      +    "finalAnswer": {
      +      "type": "string"
      +    },
      +    "manifest": {
      +      "additionalProperties": true,
      +      "type": "object"
      +    },
      +    "message": {
      +      "type": "string"
      +    },
      +    "operationId": {
      +      "type": "string"
      +    },
      +    "preview": {
      +      "additionalProperties": true,
      +      "type": "object"
      +    },
      +    "requiresConfirmation": {
      +      "type": "boolean"
      +    },
      +    "responseGuidance": {
      +      "type": "string"
      +    },
      +    "reviewExpensesUrl": {
      +      "type": "string"
      +    },
      +    "status": {
      +      "type": "string"
      +    },
      +    "success": {
      +      "type": "boolean"
      +    },
      +    "undo": {
      +      "additionalProperties": true,
      +      "type": "object"
      +    }
      +  },
      +  "required": [
      +    "success",
      +    "status"
      +  ],
      +  "type": "object"
      +}
  4. 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
  5. Changed8 schema fields changed
    • addedInput schema / properties / change / properties / attendees / description
      Added value: +"Attendee names explicitly supplied by the user when type is attendees; never infer names."
    • addedInput schema / properties / change / properties / businessPurpose / description
      Added value: +"User-supplied business purpose to apply when type is businessPurpose."
    • addedInput schema / properties / change / properties / category / description
      Added value: +"Configured expense category to apply when type is category."
    • addedInput schema / properties / change / properties / type / description
      Added value: +"The one correction kind to apply to every exact selected expense."
    • addedInput schema / properties / selection / description
      Added value: +"Exact expenses returned by search_expenses and approved for this bounded correction."
    • 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 / properties / category / description
      Added value: +"Current category observed before preview for conflict detection."
    • addedInput schema / properties / selection / properties / items / items / properties / expected / properties / notes / description
      Added value: +"Current structured Notes value observed before preview for conflict detection."
  6. First observed

TDQS

A4.6/5.0
Behavior4/5

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

Annotations already flag destructive=true and openWorldHint=true, but the description adds substantial context they don't cover: the preview-then-confirm protocol, operationId idempotency and reuse of an identical payload, terminal result fields (applied/conflicted/failed counts, status, Undo), and hard boundaries (never infer names, preserve card/description/inbox Notes segments, skip Formula Notes/overflow, no amount/date changes). The only gap is that the Undo window duration is referenced but never quantified.

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

Conciseness4/5

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

Front-loaded with the action and the mandatory prerequisite, then the approval loop, then boundaries and escalation. It is dense semicolon-chained prose that rewards careful reading but wastes little; the support-URL sentence is long but earns its place by covering the unsupported cases.

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 destructive, nested-schema bulk mutation with an output schema, this covers what structured fields cannot: the approval workflow, idempotency, data that must be preserved, and what not to attempt. Return-value detail is correctly left to the output schema, with only the terminal result summarized.

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?

Schema coverage is 100%, so the baseline is 3, but the description genuinely extends it: it explains the confirm-omitted preview behavior and early-confirm fallback, the operationId reuse contract, and what attendeeMode 'replace' actually mutates (only that Notes segment) versus 'add' preserving existing attendees. It leaves the role of selection.expected conflict detection almost entirely 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?

Opens with a specific verb pair (preview and correct) plus the exact resource and the three correctable fields (category, business purpose, attendees), and scopes it to 'exact expenses'. It also names the sibling it replaces (update_expense for merchant/tag) and the one it must follow (search_expenses), so an agent can place it without opening a schema.

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?

Explicit routing: use search_expenses first for expenseIds, use omit_expenses for omit/restore, use update_expense for a single row's merchant or tag, and the support URL for mixed/unsupported/over-100-row cases. It also states the precondition (explicit user approval) that gates the confirm:true call.

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.