unity_undo_last
Revert the most recent undoable MCP action. Optionally target a specific agent's action or force revert newer actions stacked on top due to linear undo.
Instructions
Revert the most recent undoable MCP action as a whole (create/edit/boolean, not one internal step — each write runs in its own named undo group). With agentId, targets that agent's most recent action. Unity's undo is LINEAR: reverting an action also reverts anything newer stacked on it, so this refuses to cascade and lists what would be affected unless force:true. (execute-code and reads are never targets.)
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| port | No | Unity instance port (from unity_select_instance). Always include it when multiple instances run. | |
| force | No | Also revert newer actions stacked on top of the target (Unity's linear undo). Default false. | |
| agentId | No | Optional: revert this agent's most recent action instead of the global newest (see unity_undo_history for ids). |