clear_level
Remove all elements from an Ice Puzzle level while maintaining the grid size for redesign or resetting layouts.
Instructions
Clear all elements from the level, keeping grid size
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/grid-operations.ts:114-129 (handler)The clear_level tool handler implementation. Gets the current draft, clears all elements (obstacles, warpPairs, thinIceTiles, pushableRocks, pressurePlate, barrier, lastSolverResult) while preserving grid size, start, and goal positions, then renders and returns the cleared level visualization.{ name: 'clear_level', description: 'Clear all elements from the current level, keeping grid size, start, and goal.', inputSchema: { type: 'object', properties: {} }, handler: async () => { const draft = draftStore.getCurrentDraft(); if (!draft) return { content: [{ type: 'text', text: 'No active draft. Use create_level first.' }] }; draftStore.updateDraft({ obstacles: [], warpPairs: [], thinIceTiles: [], pushableRocks: [], pressurePlate: null, barrier: null, isDirty: true, lastSolverResult: null, }); const current = draftStore.getCurrentDraft()!; const viz = renderLevel(current, { showCoords: true }); return { content: [{ type: 'text', text: `Level cleared.\n\n${viz}` }] }; }, },
- src/tools/grid-operations.ts:117-117 (schema)Input schema for clear_level tool - an empty object since no parameters are required.inputSchema: { type: 'object', properties: {} },
- src/tools/grid-operations.ts:114-129 (registration)Tool registration definition including name, description, inputSchema, and handler for clear_level within the getGridOperationTools() function array.{ name: 'clear_level', description: 'Clear all elements from the current level, keeping grid size, start, and goal.', inputSchema: { type: 'object', properties: {} }, handler: async () => { const draft = draftStore.getCurrentDraft(); if (!draft) return { content: [{ type: 'text', text: 'No active draft. Use create_level first.' }] }; draftStore.updateDraft({ obstacles: [], warpPairs: [], thinIceTiles: [], pushableRocks: [], pressurePlate: null, barrier: null, isDirty: true, lastSolverResult: null, }); const current = draftStore.getCurrentDraft()!; const viz = renderLevel(current, { showCoords: true }); return { content: [{ type: 'text', text: `Level cleared.\n\n${viz}` }] }; }, },