gui_undo
Reverse unintended graphical user interface actions to restore previous states in Anki MCP, ensuring accuracy in workflow and data integrity.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/graphical.ts:417-431 (handler)The handler function for the 'gui_undo' MCP tool. It registers the tool with no input parameters and executes AnkiConnect's graphical.guiUndo() action, returning a success message with the result or throwing an error.server.tool('gui_undo', {}, async () => { try { const result = await ankiClient.graphical.guiUndo(); return { content: [ { type: 'text', text: `Successfully performed undo. Result: ${result}`, }, ], }; } catch (error) { throw new Error(`Failed to undo: ${error instanceof Error ? error.message : String(error)}`); } });
- src/tools/graphical.ts:417-431 (registration)Registration of the 'gui_undo' tool using server.tool() within the registerGraphicalTools function.server.tool('gui_undo', {}, async () => { try { const result = await ankiClient.graphical.guiUndo(); return { content: [ { type: 'text', text: `Successfully performed undo. Result: ${result}`, }, ], }; } catch (error) { throw new Error(`Failed to undo: ${error instanceof Error ? error.message : String(error)}`); } });