Skip to main content
Glama

undo_apply

Destructive

Apply a recorded reversal by dispatching its inverse tool; use dry_run to preview without executing. Each token can only be applied once.

Instructions

[WRITE][risk=medium] Apply a recorded undo by dispatching its inverse tool.

The inverse runs through its own governed tool, so its real risk tier is
tagged on its own audit row there. Pass dry_run=True to preview the
inverse call without executing it. A token can only be applied once.

Args:
    undo_id: The undoId from undo_list (or an ``_undo_id`` in a write result).
    dry_run: If True, preview the inverse tool + params without running it.
    target: Passed through to the inverse tool when it accepts a target.

Input Schema

NameRequiredDescriptionDefault
targetNo
dry_runNo
undo_idYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.3/5.0
Behavior4/5

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

Annotations already declare destructiveHint=true and idempotentHint=false, so the safety profile is partly covered. The description adds real value beyond that: the inverse executes through its own governed tool with its own risk tier and audit row, dry_run previews without executing, and the one-time token constraint explains the non-idempotency. This is meaningful behavioral context, though it doesn't describe failure modes or what the inverse call returns.

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 a risk tag and a one-line summary, followed by an Args block. Sentences are tight and each adds information, though the risk-tier/audit-row sentence is slightly verbose for the value it conveys.

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 3-param write tool with no output schema and only basic annotations, the description covers purpose, the dry-run preview path, the one-time constraint, and all parameters. It is nearly complete, missing only what the inverse dispatch returns or how failures surface.

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 0%, so the description carries the full param burden and does so: undo_id is explained as the token from undo_list, dry_run as a preview switch, and target as a pass-through to the inverse tool when accepted. This compensates well for the empty schema, though target's valid values/format remain unspecified.

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?

The description gives a specific verb+resource ('Apply a recorded undo') and explains the mechanism (dispatching its inverse tool), which distinguishes it from undo_list, which only enumerates tokens. An agent can tell immediately this executes a pending undo rather than listing them.

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?

It clearly states how to preview safely (dry_run=True) and that a token can only be applied once, plus where the undo_id comes from (undo_list or an _undo_id in a write result). It stops short of explicitly naming when NOT to use it or contrasting against re-issuing the original tool, so it is strong context without full alternative routing.

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