Skip to main content
Glama

Update expense

crunch_update_expense
Idempotent

Update an existing expense by changing posting date, supplier, reference, note, or replacing line items while preserving payments and attachments.

Instructions

Change an expense. The current expense is fetched and only what you pass changes: posting_date, supplier, reference, note, or line_items (which replace all lines). Payments and attachments are kept as they are; use crunch_add_expense_payment, crunch_remove_expense_payment and crunch_add_expense_attachment for those. Reconciled expenses and closed years can't be changed.

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": {
      "expense_id": "<expense_id>"
    },
    "name": "crunch_update_expense"
  }
}

Input Schema

NameRequiredDescriptionDefault
noteNoNew internal note
changesNoRaw ExpenseDto fields to merge into the current expense (advanced)
dry_runNoPreview: return the request that would be sent (for an update, the fields that would change) without sending it
expense_idYesExpense ID (see crunch_list_expenses)
line_itemsNoReplacement lines (all existing lines are replaced)
supplier_idNoMove the expense to this supplier
posting_dateNoNew date (YYYY-MM-DD)
supplier_referenceNoNew supplier reference

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.7.0

TDQS

A4.8/5.0
Behavior5/5

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

Annotations only declare the safety profile (not read-only, idempotent, non-destructive); the description adds the actual mutation semantics — fetch-then-merge, only passed fields change, line_items wholesale replace all lines, and payments/attachments survive untouched. It also discloses a real business constraint (reconciled expenses / closed years are rejected) that no structured field carries.

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

Conciseness5/5

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

Three tight sentences: what it does, the exact merge rule, then the carve-outs and constraints. Every clause carries information an agent needs, and the most decision-relevant detail (only what you pass changes) is front-loaded.

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

Completeness4/5

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

For an 8-parameter mutation with nested line items and no output schema, the description covers the mutation model, side effects on sub-resources, and blocking conditions. The only gap is that it never says what comes back after a successful update (or that dry_run returns a preview), which the schema covers for dry_run but not for the success path.

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 adds the merge semantics that the schema does not express: only supplied fields are applied to the fetched expense, and line_items overwrite rather than append. It stops short of explaining the advanced `changes` object or dry_run, which remain schema-only.

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 ("Change an expense") and immediately enumerates the mutable fields (posting_date, supplier, reference, note, line_items), which lets an agent distinguish it from crunch_create_expense and the payment/attachment siblings without opening any 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?

Explicitly routes the agent elsewhere for adjacent operations by naming crunch_add_expense_payment, crunch_remove_expense_payment and crunch_add_expense_attachment, and states a hard precondition: reconciled expenses and closed years can't be changed. This is a clear when/when-not pair with named alternatives.

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

Deploy Server

Other Tools