Undo a logged mailbox change
undo_actionReverses a single logged mailbox change on request, such as a move, read-state, label, or folder-rule action, and reports 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 a chunk of a folder rules run, 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.
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": {
"log_id": "<log_id>"
},
"name": "undo_action"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| log_id | Yes | The original action's log_id, 32 lowercase hexadecimal characters, from its result or list_actions. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||