Skip to main content
Glama

Undo a logged mailbox change

undo_action
Destructive

Reverse a logged mailbox change—such as a move, read-state, label, or rule application—when the user asks to undo, and report any messages that cannot be restored.

Instructions

Reverse one logged mailbox change, once, at the user's request; reports messages it can no longer restore.

Use it only when the user asks to undo. It reverses a move to Trash, Archive or a folder, a read-state or label change, or an apply_rules chunk, by the log_id that call returned (one per log_ids entry) or list_actions finds. It takes no preview or token, and is audited. Draft deletion, unsubscribe, sending, folder creation, saved rules, reindex and preview records cannot be undone.

A large chunk may need several calls: partial=true with "Undo time budget reached" (and deferred, the messages not yet examined) means call again with the same original log_id; each call restores only messages not yet restored, and a finished undo refuses as already undone.

Returns this attempt's own log_id, count, messages, missing and partial, with deferred, unresolved (rows of prior attempts, by their log_id) and error when they apply. An unknown or non-undoable log_id refuses, and so does a chunk over 200 messages.

Input Schema

NameRequiredDescriptionDefault
log_idYesThe original action's log_id, 32 lowercase hexadecimal characters, from its result or list_actions.

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.5/5.0
Behavior3/5

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

The description goes well beyond the annotations, disclosing that the operation is audited, that it needs no preview or token, the refusal conditions (unknown, non-undoable, already undone, chunks over 200 messages), and the multi-call partial/deferred continuation protocol. With annotations already declaring destructiveHint=true, readOnly=false and idempotentHint=false, the description adds real behavioral context, so this is strong rather than merely adequate. The only gap is that it doesn't warn about the safety profile of an irreversible destructive undo beyond what the hints already convey.

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?

Four tight paragraphs, each front-loaded with its point: purpose first, eligibility second, continuation protocol third, return/refusal semantics last. No filler sentences.

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?

Covers the destructive nature, provenance of the input, resumability across calls, the size ceiling, and terminal failure modes. Since an output schema exists and the description still sketches the returns (log_id, count, messages, missing, partial, deferred, unresolved, error), nothing an agent needs 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% and the sole parameter already documents format and provenance, so the baseline would be 3. The description earns above baseline by clarifying that the log_id is the one "that call returned (one per log_ids entry)" and that repeated calls for a large chunk must reuse the same original log_id.

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 ("Reverse one logged mailbox change") plus scope constraints ("once, at the user's request"). It also names the siblings that feed it (list_actions, apply_rules, preview_action as the non-undoable counterpart), so an agent can separate it from its 29 siblings without opening a 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?

Gives an explicit when-to-use gate ("Use it only when the user asks to undo") and enumerates what is undoable versus what cannot be undone (draft deletion, unsubscribe, sending, folder creation, saved rules, reindex, previews). It names list_actions as the way to obtain a log_id, so routing is fully specified.

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