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}` }] };
      },
    },
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden. It states the tool clears elements and preserves grid size, but lacks critical behavioral details: whether this action is reversible (e.g., via 'undo'), if it affects saved drafts, what 'elements' encompass (tiles, objects, etc.), or any permissions required. For a mutation tool with zero annotation coverage, this is a significant gap.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that front-loads the core action ('Clear all elements from the level') and adds a key constraint ('keeping grid size'). There is no wasted verbiage, making it highly concise and well-structured for quick understanding.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (a mutation operation with no annotations and no output schema), the description is incomplete. It lacks details on what 'elements' include, the impact on level state (e.g., draft vs. published), reversibility, and error conditions. For a tool that modifies level data, this leaves too many unknowns for safe and effective use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 0 parameters with 100% coverage, so no parameter documentation is needed. The description adds context by specifying that grid size is preserved, which is useful semantic information beyond the empty schema. This compensates adequately, though not perfectly as it doesn't detail side effects.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Clear all elements') and the resource ('from the level'), with a specific constraint ('keeping grid size'). It distinguishes from sibling 'clear_region' by operating on the entire level rather than a region. However, it doesn't explicitly contrast with other deletion tools like 'remove_tile' or 'delete_draft', keeping it from a perfect score.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No explicit guidance is provided on when to use this tool versus alternatives. The description implies it clears all elements while preserving grid size, but it doesn't specify scenarios (e.g., resetting a level vs. partial edits) or mention sibling tools like 'clear_region' for targeted clearing. This leaves usage context ambiguous.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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