Skip to main content
Glama

create_level

Create a new empty ice puzzle level by specifying dimensions and name for designing sliding block challenges.

Instructions

Create a new empty ice puzzle level

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesLevel name
widthNoGrid width (5-25, default 10)
heightNoGrid height (5-25, default 10)

Implementation Reference

  • Complete tool registration for create_level including name, description, input schema, and handler function.
    {
      name: 'create_level',
      description: 'Create a new empty ice puzzle level. This becomes the current working draft.',
      inputSchema: {
        type: 'object',
        properties: {
          name: { type: 'string', description: 'Level name' },
          width: { type: 'number', description: 'Grid width (5-25, default 10)', minimum: 5, maximum: 25 },
          height: { type: 'number', description: 'Grid height (5-25, default 10)', minimum: 5, maximum: 25 },
        },
        required: ['name'],
      },
      handler: async (args) => {
        const draft = draftStore.createDraft(args.name, args.width, args.height);
        const viz = renderLevel(draft, { showCoords: true });
        return { content: [{ type: 'text', text: `Level "${args.name}" created!\n\n${formatDraftSummary(draft)}\n\n${viz}` }] };
      },
    },
  • Input schema defining the accepted arguments: name (required string), width (optional number 5-25, default 10), height (optional number 5-25, default 10).
    inputSchema: {
      type: 'object',
      properties: {
        name: { type: 'string', description: 'Level name' },
        width: { type: 'number', description: 'Grid width (5-25, default 10)', minimum: 5, maximum: 25 },
        height: { type: 'number', description: 'Grid height (5-25, default 10)', minimum: 5, maximum: 25 },
      },
      required: ['name'],
    },
  • Handler function that creates a new level draft using draftStore.createDraft() and returns a formatted response with level summary and visualization.
    handler: async (args) => {
      const draft = draftStore.createDraft(args.name, args.width, args.height);
      const viz = renderLevel(draft, { showCoords: true });
      return { content: [{ type: 'text', text: `Level "${args.name}" created!\n\n${formatDraftSummary(draft)}\n\n${viz}` }] };
    },
  • The createDraft method in DraftStore that initializes a new DraftState with default positions (bottom-left start, top-right goal), empty obstacles/warps, and resets history.
    createDraft(name: string, width: number = 10, height: number = 10): DraftState {
      this.warpCounter = 1;
      this.undoStack = [];
      this.redoStack = [];
      this.lastSolvableSnapshot = null;
      const draft: DraftState = {
        id: null,
        previewId: null,
        name,
        description: '',
        gridWidth: width,
        gridHeight: height,
        par: 0,
        startPosition: { x: 1, y: height - 2 }, // bottom-left
        goalPosition: { x: width - 2, y: 1 }, // top-right
        obstacles: [],
        warpPairs: [],
        thinIceTiles: [],
        pushableRocks: [],
        pressurePlate: null,
        barrier: null,
        manualSolveMechanicsBaseline: null,
        manualSolveFingerprint: null,
        isDirty: false,
        lastSolverResult: null,
      };
      this.currentDraft = draft;
      return draft;
    }
  • formatDraftSummary helper function used by the handler to display level information including grid size, par, start/goal positions, obstacles, warps, and solver status.
    function formatDraftSummary(draft: DraftState): string {
      const solverInfo = draft.lastSolverResult
        ? formatSolverResult(draft.lastSolverResult)
        : 'Not yet solved';
      return [
        `Name: ${draft.name}`,
        `Grid: ${draft.gridWidth}x${draft.gridHeight}`,
        `Par: ${draft.par > 0 ? draft.par : 'not set'}`,
        `Start: (${draft.startPosition.x}, ${draft.startPosition.y})`,
        `Goal: (${draft.goalPosition.x}, ${draft.goalPosition.y})`,
        `Obstacles: ${draft.obstacles.length}`,
        `Warps: ${draft.warpPairs.length} pairs`,
        `Thin Ice: ${draft.thinIceTiles.length}`,
        `Pushable Rocks: ${draft.pushableRocks.length}`,
        draft.pressurePlate ? `Pressure Plate: (${draft.pressurePlate.x}, ${draft.pressurePlate.y})` : '',
        draft.barrier ? `Barrier: (${draft.barrier.x}, ${draft.barrier.y})` : '',
        `Solver: ${solverInfo}`,
      ].filter(Boolean).join('\n');
    }
Behavior2/5

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

With no annotations provided, the description carries full burden but only states the basic action. It doesn't disclose behavioral traits like whether this requires authentication, creates a draft or published level, what happens on success/failure, or if there are rate limits. The description is minimal and lacks critical operational context.

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 zero waste. It's front-loaded with the core action and resource, making it immediately understandable without unnecessary elaboration.

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?

For a creation tool with no annotations and no output schema, the description is incomplete. It doesn't explain what 'empty' entails (e.g., no tiles, default layout), the return value (e.g., level ID, success confirmation), or error conditions. Given the complexity of level creation in this context, more context is needed.

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%, so the schema fully documents all parameters (name, width, height). The description adds no additional meaning beyond implying these parameters define the level, which is already clear from the schema. Baseline 3 is appropriate when schema does the heavy lifting.

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

Purpose5/5

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

The description clearly states the specific action ('Create') and resource ('new empty ice puzzle level'), distinguishing it from sibling tools like 'set_grid_size' (which modifies existing levels) or 'import_level' (which creates from external data). It precisely defines what the tool does.

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?

The description provides no guidance on when to use this tool versus alternatives like 'import_level' (which creates from import) or 'seed_layout_pattern' (which creates with initial content). It also doesn't mention prerequisites, such as whether authentication is required or if this creates a draft versus published level.

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