Skip to main content
Glama

ms_next_turn

Resets the step counter and grants 8 fresh steps to continue the tic-tac-toe game after reaching the turn limit. Call after chat.

Instructions

The Flufflings catch their breath and check in with the player. Resets the step counter and gives 8 fresh steps. Must be called after reaching the turn limit — chat first, then call this to continue the crossing.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Registration of the ms_next_turn tool via server.tool() with name 'ms_next_turn', description, empty schema, and async handler.
    server.tool(
      "ms_next_turn",
      "The Flufflings catch their breath and check in with the player. Resets the step counter and gives 8 fresh steps. Must be called after reaching the turn limit — chat first, then call this to continue the crossing.",
      {},
      async () => {
        if (msGame.status === "won" || msGame.status === "lost") {
          return { content: [{ type: "text", text: `The crossing is over (${msGame.status}). Call ms_new_game to try again.` }], isError: true };
        }
        if (msGame.status === "waiting") {
          return { content: [{ type: "text", text: `The Flufflings haven't started yet. Send the first scout with ms_reveal_cell.` }], isError: true };
        }
        if (msGame.status === "in_progress") {
          return { content: [{ type: "text", text: `The Flufflings are still moving (${msGame.movesThisTurn}/${msGame.maxMovesThisTurn} steps used). Finish the turn first.` }], isError: true };
        }
    
        msGame.status = "in_progress";
        msGame.movesThisTurn = 0;
        msGame.maxMovesThisTurn = MOVES_PER_TURN;
        msGame.turnNumber++;
    
        return {
          content: [{
            type: "text",
            text: `The Flufflings are ready again! Turn ${msGame.turnNumber} — ${MOVES_PER_TURN} steps available.\n\n${renderState(msGame)}`,
          }],
        };
      }
    );
  • The async handler function that implements the ms_next_turn logic. It checks game status, resets movesThisTurn to 0, sets maxMovesThisTurn to MOVES_PER_TURN (8), increments turnNumber, and returns the updated state.
      async () => {
        if (msGame.status === "won" || msGame.status === "lost") {
          return { content: [{ type: "text", text: `The crossing is over (${msGame.status}). Call ms_new_game to try again.` }], isError: true };
        }
        if (msGame.status === "waiting") {
          return { content: [{ type: "text", text: `The Flufflings haven't started yet. Send the first scout with ms_reveal_cell.` }], isError: true };
        }
        if (msGame.status === "in_progress") {
          return { content: [{ type: "text", text: `The Flufflings are still moving (${msGame.movesThisTurn}/${msGame.maxMovesThisTurn} steps used). Finish the turn first.` }], isError: true };
        }
    
        msGame.status = "in_progress";
        msGame.movesThisTurn = 0;
        msGame.maxMovesThisTurn = MOVES_PER_TURN;
        msGame.turnNumber++;
    
        return {
          content: [{
            type: "text",
            text: `The Flufflings are ready again! Turn ${msGame.turnNumber} — ${MOVES_PER_TURN} steps available.\n\n${renderState(msGame)}`,
          }],
        };
      }
    );
  • The input schema for ms_next_turn — an empty object ({}), meaning the tool takes no parameters.
    {},
  • The applyTurnLimit helper function that sets status to 'paused' when movesThisTurn reaches maxMovesThisTurn, which is the condition that leads the player to need to call ms_next_turn.
    function applyTurnLimit(state: MinesweeperState): void {
      if (state.movesThisTurn >= state.maxMovesThisTurn) {
        state.status = "paused";
      }
    }
  • The renderState helper that displays the 'paused' message prompting the user to call ms_next_turn when appropriate.
    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");
    }
Behavior4/5

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

With no annotations, the description fully discloses behavior: it resets step counter and gives 8 steps. It does not mention side effects, permissions, or error conditions, but for a simple action this is adequate. No contradictions with annotations (none provided).

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?

Two sentences with no wasted words. The first sentence states purpose, the second gives usage instructions. Information is front-loaded, and every sentence earns its place. Ideal conciseness.

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

Completeness5/5

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

Given the tool's simplicity (no parameters, no output schema), the description is complete. It explains what happens and when to call it. No additional context is needed for an agent to invoke it correctly.

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 tool has no parameters, and schema coverage is 100% (empty schema). The description adds meaning by explaining what the tool accomplishes (resetting, granting steps), which is more than the schema alone provides. Baseline for 0 parameters is 4, and this meets it.

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 tool's purpose: 'The Flufflings catch their breath and check in with the player. Resets the step counter and gives 8 fresh steps.' It provides a specific verb and resource, distinguishing it from siblings like ms_reveal_cell by being a turn-management action. However, it does not explicitly contrast with similar turn tools from other games (e.g., cc_new_turn), though the context is distinct.

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 explicitly states when to use: 'Must be called after reaching the turn limit — chat first, then call this to continue the crossing.' This gives clear usage context and prerequisites, though it does not mention alternatives or when not to use it. The instruction is direct and helpful.

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