Skip to main content
Glama

add_thin_ice

Add breakable thin ice tiles to puzzle levels that disappear after being crossed, creating temporary pathways and strategic challenges for players.

Instructions

Add thin ice tiles (break after crossing)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
positionsYesPositions for thin ice

Implementation Reference

  • Main MCP tool handler for 'add_thin_ice'. Defines tool name, description, input schema, and the async handler function that validates positions, calls draftStore.addThinIce, and returns results with solver visualization.
    {
      name: 'add_thin_ice',
      description: 'Add thin ice tiles that break after the player crosses them',
      inputSchema: {
        type: 'object',
        properties: {
          positions: {
            type: 'array',
            items: {
              type: 'object',
              properties: {
                x: { type: 'number' },
                y: { type: 'number' }
              },
              required: ['x', 'y']
            },
            description: 'Array of positions to place thin ice'
          }
        },
        required: ['positions']
      },
      handler: async (args: { positions: Position[] }) => {
        const error = checkActiveDraft();
        if (error) {
          return { content: [{ type: 'text', text: error }] };
        }
    
        const draft = draftStore.getCurrentDraft()!;
    
        for (const pos of args.positions) {
          const validationError = checkPositionValid(pos.x, pos.y, draft.gridWidth, draft.gridHeight);
          if (validationError) {
            return { content: [{ type: 'text', text: validationError }] };
          }
        }
        draftStore.addThinIce(args.positions);
    
        const result = autoSolveAndVisualize();
    
        return {
          content: [{
            type: 'text',
            text: `Added thin ice at ${args.positions.length} position(s)\n\n${result}`
          }]
        };
      }
  • Tool registration: The add_thin_ice tool is exported via getSpecialElementTools() function which returns an array of tool definitions.
    export function getSpecialElementTools(): ToolDefinition[] {
      return [
  • Input schema definition for add_thin_ice tool. Specifies that it requires a 'positions' array containing objects with 'x' and 'y' number properties.
    inputSchema: {
      type: 'object',
      properties: {
        positions: {
          type: 'array',
          items: {
            type: 'object',
            properties: {
              x: { type: 'number' },
              y: { type: 'number' }
            },
            required: ['x', 'y']
          },
          description: 'Array of positions to place thin ice'
        }
      },
      required: ['positions']
    },
  • Position type definition used by the add_thin_ice tool. Defines the structure with x and y number properties.
    export interface Position {
      x: number;
      y: number;
    }
  • Core implementation of addThinIce method. Validates current draft, pushes history, clears existing tiles at positions, deduplicates new positions, and updates the draft with thinIceTiles.
    addThinIce(positions: Position[]): DraftState {
      if (!this.currentDraft) {
        throw new Error('No current draft');
      }
    
      this.pushHistorySnapshot();
      return this.runWithHistorySuspended(() => {
        const incoming = this.dedupePositions(positions);
        for (const position of incoming) {
          this.clearPosition(position.x, position.y);
        }
    
        const thinIceTiles = this.dedupePositions([...this.currentDraft!.thinIceTiles, ...incoming]);
        return this.updateDraft({ thinIceTiles }, { trackHistory: false });
      });
    }
Behavior2/5

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

No annotations are provided, so the description carries full burden. It mentions the tile's behavior ('break after crossing'), which is useful, but lacks critical details: whether this is a mutation (implied by 'Add'), what permissions are needed, if it affects game state, or what happens on success/failure. For a tool with no annotations, this is insufficient.

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 with a clarifying parenthetical. It's front-loaded with the core action and wastes no words, making it easy to parse quickly.

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 no annotations and no output schema, the description is incomplete for a mutation tool. It lacks information on behavioral impact (e.g., whether changes are saved immediately), error conditions, or return values. The context of level editing is implied but not stated, leaving gaps for the agent.

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

Parameters3/5

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

Schema description coverage is 100%, with the parameter 'positions' documented as 'Positions for thin ice'. The description adds no additional parameter semantics beyond this, but the schema provides adequate detail. With high coverage, the baseline score of 3 is appropriate.

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 ('Add thin ice tiles') and the resource ('thin ice tiles'), with the parenthetical explaining the tile's behavior ('break after crossing'). This distinguishes it from sibling tools like 'remove_thin_ice' and 'place_tile', though it doesn't explicitly contrast with other tile-adding tools like 'add_pushable_rock'.

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 guidance is provided on when to use this tool versus alternatives. The description doesn't mention prerequisites, context (e.g., level editing), or comparisons to similar tools like 'place_tile' or 'add_pushable_rock', leaving the agent to infer usage from the tool name alone.

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