Skip to main content
Glama

Undo recent changes

undo_changes
Destructive

Undo (revert, roll back, cancel) a recent write_events / delete_events batch, a review_day action, or a manage_inbox or manage_categories call. Pass tokens: the undoToken values that those calls returned, before their expiresAt (a UTC instant, 30 minutes). A token reverses the whole change. If a row that the write touched changed again later (for example, the event moved or was deleted), that token fails with stale and nothing changes; conflictingRows gives up to 50 row ids with a reason (changed, deleted, newly_present), and conflictingRowsTruncated: true means more. Several tokens undo the newest write first, in any order. Each result counts reverted, restored, removed and voided. To reset a day's reflection, use review_day 'discard'.

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": {
      "tokens": "<tokens>"
    },
    "name": "undo_changes"
  }
}

Input Schema

NameRequiredDescriptionDefault
tokensYesThe `undoToken` from an earlier write’s successfully recorded undo receipt.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / properties / tokens / description
      Previous value: -"The `undoToken` that an earlier write returned. Every write that can be reversed returns one."New value: +"The `undoToken` from an earlier write’s successfully recorded undo receipt."
  2. Changed3 schema fields changed
    • addedInput schema / additionalProperties
      Added value: +false
    • removedInput schema / properties / llm_model
      Removed value: -{
      -  "description": "The exact model identifier you (the assistant) are running as, taken from your system prompt or environment (e.g. \"claude-opus-4-8\", \"gpt-5.2\"). Used for analytics only. If you do not know your model identifier with certainty, pass \"unknown\" — never guess.",
      -  "type": "string"
      -}
    • changedInput schema / required
      Previous value: -[
      -  "tokens",
      -  "llm_model"
      -]New value: +[
      +  "tokens"
      +]
  3. Added

TDQS

A4.8/5.0
Behavior5/5

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

Annotations only say destructive=true, openWorld=false, readOnly=false; the description goes far beyond by disclosing atomic all-or-nothing semantics, the exact stale-detection rule (row changed again later), the failure mode (nothing changes), the error shape (stale, conflictingRows up to 50 with reasons changed/deleted/newly_present, conflictingRowsTruncated), and per-result counters (reverted, restored, removed, voided). This is the behavioral context an agent needs before calling a destructive tool.

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 verb and the affected operations, then constraints, then failure semantics, then result shape — a sensible order. It is dense in a single paragraph with many clauses, but no sentence is filler; only light structural tightening (e.g., splitting failure/result detail) would improve scanability.

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?

There is no output schema, so the description carries the burden of describing results — and it does, naming the four counters and the conflict payload. Combined with the expiry rule, ordering rule, and the pointer to review_day discard, nothing an agent needs to invoke or interpret this destructive tool is missing.

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 parameter itself is already documented, but the description adds real meaning: tokens are single-use-ish receipts with a 30-minute UTC expiry, each token reverses an entire change atomically, and multiple tokens are applied newest-write-first regardless of order. It doesn't state the 20-token cap that the schema enforces, which is a minor omission.

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 with synonyms ('Undo (revert, roll back, cancel)') and enumerates exactly which upstream operations it reverses: write_events / delete_events batches, review_day, manage_inbox, manage_categories. An agent can immediately tell this apart from sibling tools like delete_events or review_day.

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 says what to pass (undoToken values from prior calls) and the condition that makes them valid (before expiresAt, 30 minutes). It also names the alternative for a related case: 'To reset a day's reflection, use review_day discard', which routes the agent away from this tool where appropriate.

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.