Skip to main content
Glama

Undo Change

undo_change
Destructive

Revert a specific Gramps Web transaction by restoring updated and deleted records and removing added ones. Preview effects and conflicts with dryRun before confirming the undo.

Instructions

Undo one transaction listed by get_recent_changes: records it added are deleted, records it updated get their earlier version back, and records it deleted are restored with the same handles and Gramps IDs. The undo is one new all-or-nothing transaction, which get_recent_changes lists and undo_change can revert in turn. Call it only after the user confirmed that transaction; dryRun lists the effects and conflicts without changing anything. A conflict stops the undo with nothing changed: a record changed again later, a record to be deleted that other records now link to, or an earlier version linking a record that no longer exists. Undo the later transactions first, newest first, or pass force=true after a separate confirmation. Clients that support it also show the user a confirmation dialog before undoing; action declined or cancelled means the user said no. Returns action undone, checked, refused or pending, the records affected and the undo's own transaction number.

Input Schema

NameRequiredDescriptionDefault
forceNotrue undoes despite conflicts, overwriting later changes to these records and possibly leaving links dangling; only after a separate confirmation (default false).
dryRunNotrue only lists what the undo would change and its conflicts, writing nothing (default false).
transactionIdYesThe transaction to undo: the number shown as [transaction: N] by get_recent_changes.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv2.7.0

TDQS

A4.8/5.0
Behavior5/5

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

Well beyond the destructiveHint/openWorldHint annotations, it discloses that the undo is a single all-or-nothing transaction that is itself reversible, enumerates the three conflict classes that abort with nothing changed, and explains the client-side confirmation dialog and what a declined action means. It even lists the returned action states (undone, checked, refused, pending).

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?

Effects are front-loaded and the progression (what it does → confirmation requirement → conflicts → ordering/force → return values) is logical. It runs long at roughly six sentences and the trailing sentence on return states plus the client-dialog aside are somewhat stacked, but each carries distinct operational information rather than repetition.

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?

With no output schema, the description compensates by naming the return values; for a destructive, non-idempotent mutation it covers reversibility, atomicity, conflict failure modes, escape hatches (dryRun, force), and required user confirmation. An agent has everything needed to invoke it safely without trial and error.

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; the description adds real value by explaining what conflict conditions force overrides and why a separate confirmation is required, plus that dryRun reports conflicts without writing. It does not add format or syntax detail for transactionId beyond the schema's pointer to get_recent_changes.

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 ('Undo one transaction listed by get_recent_changes') and then spells out the exact effects: added records deleted, updated records reverted, deleted records restored. An agent can distinguish this from every sibling, including get_recent_changes, which it explicitly references as the source of the transaction ID.

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 preconditions ('Call it only after the user confirmed that transaction') and an ordering rule for conflicts ('Undo the later transactions first, newest first, or pass force=true after a separate confirmation'). It also names the alternative for inspection (dryRun) and the sibling that supplies the input, leaving nothing to inference.

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