Skip to main content
Glama

ttt_new_game

Create a new Tic-Tac-Toe game where X moves first. Optionally name the players to identify each side.

Instructions

Start a fresh Tic-Tac-Toe game. X always moves first. Optionally name the players so roles are explicit in every response.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
player_x_nameNoName for the X player (e.g. 'Claude', 'Human'). Defaults to 'X'.X
player_o_nameNoName for the O player (e.g. 'Human', 'Claude'). Defaults to 'O'.O

Implementation Reference

  • Registration of the 'ttt_new_game' tool via server.tool() on line 114. The schema, handler, and registration are all inline in this single call.
    export function registerTicTacToeTools(server: McpServer): void {
      server.tool(
        "ttt_new_game",
        "Start a fresh Tic-Tac-Toe game. X always moves first. Optionally name the players so roles are explicit in every response.",
        {
          player_x_name: z
            .string()
            .optional()
            .default("X")
            .describe("Name for the X player (e.g. 'Claude', 'Human'). Defaults to 'X'."),
          player_o_name: z
            .string()
            .optional()
            .default("O")
            .describe("Name for the O player (e.g. 'Human', 'Claude'). Defaults to 'O'."),
        },
        async ({ player_x_name, player_o_name }) => ({
          content: [
            {
              type: "text",
              text: ((): string => {
                game = newGameState(player_x_name ?? "X", player_o_name ?? "O");
                return `New Tic-Tac-Toe game started.\n\n${renderState(game)}`;
              })(),
            },
          ],
        })
      );
  • Input schema for ttt_new_game: optional player_x_name and player_o_name with defaults and descriptions.
    {
      player_x_name: z
        .string()
        .optional()
        .default("X")
        .describe("Name for the X player (e.g. 'Claude', 'Human'). Defaults to 'X'."),
      player_o_name: z
        .string()
        .optional()
        .default("O")
        .describe("Name for the O player (e.g. 'Human', 'Claude'). Defaults to 'O'."),
    },
  • Handler function that creates a new game state via newGameState() and returns rendered text output.
    async ({ player_x_name, player_o_name }) => ({
      content: [
        {
          type: "text",
          text: ((): string => {
            game = newGameState(player_x_name ?? "X", player_o_name ?? "O");
            return `New Tic-Tac-Toe game started.\n\n${renderState(game)}`;
          })(),
        },
      ],
    })
  • Helper function newGameState() that initializes a fresh GameState object with empty board, default status, and player names.
    function newGameState(playerX: string, playerO: string): GameState {
      return {
        board: [
          [null, null, null],
          [null, null, null],
          [null, null, null],
        ],
        currentPlayer: "X",
        status: "in_progress",
        moveCount: 0,
        winningLine: null,
        playerX,
        playerO,
      };
    }
  • Module-level in-memory game state variable, initialized with default call to newGameState().
    let game: GameState = newGameState("X", "O");
Behavior3/5

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

With no annotations, the description must disclose behavior. It states 'Start a fresh...' implying a reset, but does not explicitly confirm that any ongoing game is destroyed. It does correctly state that X moves first, a key behavioral trait.

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, front-loading the purpose and key rule. No redundancy or wasted words. Every sentence earns its place.

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

Completeness3/5

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

The description covers invocation well but does not mention return values or what happens to the previous game state. Given no output schema, the agent lacks information about what the tool returns, though for a 'new game' tool this is partially mitigated by typical expectations.

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?

Schema coverage is 100% with parameter descriptions. The description adds value by clarifying that naming players makes roles explicit, which goes beyond the schema's default explanations. This enriches the semantic understanding for the agent.

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 'Start a fresh Tic-Tac-Toe game' with a specific verb ('Start') and resource ('Tic-Tac-Toe game'). It also notes 'X always moves first', differentiating it from other 'new_game' siblings like cc_new_game or ms_new_game, which are for different games.

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 provides clear context: 'Optionally name the players so roles are explicit in every response' explains why to use the parameters. However, it lacks explicit when-not-to-use guidance or alternatives, but given the simplicity of the tool, this is sufficient.

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