Skip to main content
Glama

Undo changes

undo-change
Destructive

Undo one or more logged changes in Foundry VTT: restore edited fields, remove created documents, or recreate deleted ones. Preview with dryRun first, and redo by undoing the undo entry.

Instructions

Undo changes from the change log: one change (changeId), the changes of one tool call (callId, optionally only the last count of them), or without either the latest tool call that is not undone yet. Updates get their recorded fields back, created documents are removed (only if unchanged since), deleted documents are recreated with their old id. Refused as a whole, with the cause, when a change cannot be undone (chat messages, notifications, world time, pause, files, settings), when the permission level for the original change is missing, or when the documents changed since (force: true restores fields anyway, never removes). Every undo is itself logged; undo that entry to redo. Use dryRun first.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
countNoWith callId or alone: only the last this many changes, 1 to 50
forceNoRestore changed fields even when the document changed since the entry; default false
callIdNoId of a tool call from list-changes; undoes its changes newest first
dryRunNoOnly check and show what would be undone; nothing is written
changeIdNoId of one change from list-changes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv14.2609.4

TDQS

A4.6/5.0
Behavior5/5

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

Annotations only indicate destructive/non-readonly/non-idempotent, but the description adds rich behavioral detail: updates get fields restored, created documents are removed only if unchanged, deleted documents are recreated with old ids, refusal causes, force semantics, and the fact that every undo is logged so undoing it redos. No contradiction with annotations.

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?

Dense and front-loaded with the core purpose, then modes, effects, refusal causes, redo behavior, and dryRun advice. Every sentence earns its place, though a bulleted structure would improve readability.

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 a complex destructive tool with no output schema, it covers selection, effects, refusals, permissions, force behavior, and the dryRun safeguard. It does not describe the actual return/result payload, but the dryRun guidance partially compensates for that gap.

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

Parameters5/5

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

Schema coverage is 100%, but the description adds essential cross-parameter meaning: how changeId, callId, and count combine, the default behavior when neither is given, force's 'restores fields anyway, never removes' effect, and dryRun's no-write behavior. These semantics are not derivable from the individual schema descriptions.

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 ('undo') and a specific resource ('changes from the change log'), and immediately distinguishes the three selection modes: one change, one tool call, or the latest not-undone call. This clearly differentiates it from siblings like list-changes and the many mutation tools.

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

Usage Guidelines4/5

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

Gives clear operational context: selection modes, refusal conditions, and the explicit instruction to use dryRun first. It does not name alternatives, but the selection logic itself makes the intended use obvious, and the changeId/callId schema descriptions reference list-changes.

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