Skip to main content
Glama

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
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • 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}` }] }; }, },
  • Input schema for clear_level tool - an empty object since no parameters are required.
    inputSchema: { type: 'object', properties: {} },
  • 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}` }] }; }, },

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/wmoten/ice-puzzle-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server