Skip to main content
Glama

ms_get_state

Check the current board state in the tic-tac-toe game. This action does not consume a turn.

Instructions

Survey the current state of the minefield. Free — does not cost a step.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The ms_get_state tool handler — returns the current rendered state of the minefield at no cost (no step consumed). Simply calls renderState(msGame) and returns it as text content.
    server.tool(
      "ms_get_state",
      "Survey the current state of the minefield. Free — does not cost a step.",
      {},
      async () => ({
        content: [{ type: "text", text: renderState(msGame) }],
      })
    );
  • Registration of ms_get_state via server.tool() inside registerMinesweeperTools(). No input schema (empty object {}) because the tool just returns state.
    server.tool(
      "ms_get_state",
      "Survey the current state of the minefield. Free — does not cost a step.",
      {},
      async () => ({
        content: [{ type: "text", text: renderState(msGame) }],
      })
    );
  • renderState() helper — builds the full text representation of the game state (board + legend + status) used by ms_get_state.
    function renderState(state: MinesweeperState): string {
      const safe = ROWS * COLS - TOTAL_MINES;
      const cleared = state.revealedCount;
      const remaining = safe - cleared;
      const lines: string[] = [renderBoard(state), ``];
    
      lines.push(`Legend:  ~ uncharted  . safe path  1-8 danger level  P warning post  ! mine`);
      lines.push(`Mission: clear all ${safe} safe squares so the Flufflings can cross | ${MOVES_PER_TURN} steps/turn then call ms_next_turn`);
      lines.push(``);
      lines.push(`Warning posts: ${state.flagCount}/${TOTAL_MINES}  |  Uncharted squares: ${remaining + state.flagCount}  |  Turn: ${state.turnNumber}`);
    
      if (state.status === "in_progress") {
        lines.push(`Steps this turn: ${state.movesThisTurn}/${state.maxMovesThisTurn}  (${state.maxMovesThisTurn - state.movesThisTurn} remaining)`);
      } else if (state.status === "paused") {
        lines.push(`⏸ The Flufflings are resting (${state.movesThisTurn}/${state.maxMovesThisTurn} steps used). Check in with your player, then call ms_next_turn to continue.`);
      } else if (state.status === "won") {
        lines.push(`🎉 The field is clear! Every Fluffling scampers to safety!`);
      } else if (state.status === "lost") {
        lines.push(`💥 A Fluffling triggered a mine! The crossing has failed. Mines shown with !`);
      } else if (state.status === "waiting") {
        lines.push(`The Flufflings are gathered at the edge, trembling. Send the first scout with ms_reveal_cell — the first step is always safe.`);
      }
    
      return lines.join("\n");
    }
  • src/index.ts:17-20 (registration)
    Top-level call to registerMinesweeperTools(server) which registers all minesweeper tools including ms_get_state.
    registerMinesweeperTools(server);
    registerBattleshipTools(server);
    registerOregonTrailTools(server);
    registerCritterCatchTools(server);
Behavior4/5

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

No annotations are provided, but the description discloses that the tool is free and does not cost a step. This is key behavioral information for a game tool, though it does not detail what 'state' includes or any side effects.

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, clear sentence with no wasted words. It is front-loaded with the main action and includes an important qualifier at the end.

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

Completeness4/5

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

Given the tool has no parameters and no output schema, the description adequately explains its purpose and a key behavioral aspect. However, it could specify what aspects of the minefield state are revealed. Still, it is complete enough for a simple survey tool.

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

Parameters5/5

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

The input schema has no parameters, and the description adds meaningful context about the tool's purpose and cost behavior, which the schema cannot convey. It fully compensates for the lack of parameters.

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 tool surveys the current state of the minefield, using a specific verb and resource. It also adds the valuable context that it is free and does not cost a step, distinguishing it from action-oriented siblings like ms_reveal_cell.

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

Usage Guidelines4/5

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

The description implies when to use this tool (to check state without cost) but does not explicitly mention alternatives or when not to use it. The 'free' hint is useful for decision-making.

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/SrmTech-git/MCPArcade'

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