Skip to main content
Glama

add_pushable_rock

Add pushable rocks to Ice Puzzle levels at specified coordinates to create obstacles and movement challenges for puzzle solving.

Instructions

Add pushable rocks

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
positionsYesPositions for pushable rocks

Implementation Reference

  • The add_pushable_rock tool handler that validates input, checks positions, and calls the store method to add pushable rocks to the draft
    {
      name: 'add_pushable_rock',
      description: 'Add pushable rocks that can be pushed one square by the player',
      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 pushable rocks'
          }
        },
        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.addPushableRock(args.positions);
    
        const result = autoSolveAndVisualize();
    
        return {
          content: [{
            type: 'text',
            text: `Added pushable rock(s) at ${args.positions.length} position(s)\n\n${result}`
          }]
        };
      }
  • The addPushableRock store method that performs the actual state update - dedupes positions, clears existing items at those positions, and updates the draft with new pushable rocks
    addPushableRock(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 pushableRocks = this.dedupePositions([...this.currentDraft!.pushableRocks, ...incoming]);
        return this.updateDraft({ pushableRocks }, { trackHistory: false });
      });
    }
  • Input schema for add_pushable_rock tool - defines positions array with x, y coordinates
    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 pushable rocks'
        }
      },
      required: ['positions']
    },
  • Export function that registers all special element tools including add_pushable_rock
    export function getSpecialElementTools(): ToolDefinition[] {
      return [
        {
  • Helper functions used by the handler - checkActiveDraft validates a draft exists, checkPositionValid validates coordinates are within grid bounds
    function checkActiveDraft(): string | null {
      const draft = draftStore.getCurrentDraft();
      if (!draft) {
        return 'No active draft. Use create_level first.';
      }
      return null;
    }
    
    function checkPositionValid(x: number, y: number, width: number, height: number): string | null {
      const result = validatePosition(x, y, width, height);
      if (!result.valid) {
        return result.error || `Position (${x}, ${y}) is out of bounds for ${width}x${height} grid`;
      }
      return null;
    }
Behavior1/5

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

No annotations are provided, so the description carries full burden for behavioral disclosure. 'Add pushable rocks' implies a mutation operation but gives no details on effects (e.g., whether rocks are interactable, affect gameplay like blocking paths, or require specific permissions). It lacks information on side effects, error conditions, or what happens if positions overlap existing elements.

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 extremely concise with just three words, front-loading the core action. There's no wasted text or redundancy. However, this brevity contributes to underspecification rather than effective communication.

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

Completeness1/5

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

Given no annotations, no output schema, and a mutation tool with potential gameplay implications, the description is severely incomplete. It doesn't explain the tool's role in the broader context (e.g., level editing), what 'pushable rocks' are functionally, or the expected outcome. For a tool that likely modifies game state, this lack of context is inadequate.

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 pushable rocks'. The description adds no additional meaning beyond this, such as coordinate systems (e.g., grid-based), valid ranges, or constraints (e.g., must be empty tiles). With high schema coverage, the baseline score of 3 is appropriate as the schema does the heavy lifting.

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

Purpose2/5

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

The description 'Add pushable rocks' is a tautology that essentially restates the tool name. While it identifies the resource ('pushable rocks') and verb ('add'), it lacks specificity about what 'add' means in this context (e.g., to a level, grid, or game state). It doesn't distinguish from sibling tools like 'remove_pushable_rock' beyond the opposite action.

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

Usage Guidelines1/5

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

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., needing an existing level), context (e.g., during level design), or comparisons to siblings like 'place_tile' or 'set_barrier' for similar placement operations. There's no indication of when this tool is appropriate or not.

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