Skip to main content
Glama

bs_new_game

Start a new Battleship game with secretly placed fleets. Pirates fire first; each ship's hidden cargo is revealed when sunk.

Instructions

Start a new Battleship game: Pirates vs the Royal Navy. Both fleets are placed secretly. Each ship carries hidden cargo revealed only when sunk. Pirates fire first.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The async handler function for bs_new_game. Calls newBsState() to reset the game state, then returns a formatted intro message with the rendered board state.
    async () => {
      bsGame = newBsState();
      return {
        content: [{
          type: "text",
          text: [
            `⚓ PIRATES vs THE ROYAL NAVY ⚓`,
            ``,
            `The Caribbean, 1698. Your pirate fleet has spotted the Royal Navy on the horizon.`,
            `Both sides carry precious cargo. Neither knows the other's position.`,
            `Send every Navy ship to the bottom — and pray they don't do the same to you first.`,
            ``,
            `Your fleet: The Scarlet Kraken, Devil's Maw, The Widow's Wail, Bone Collector, The Rusty Nail`,
            `Their fleet: HMS Sovereign, HMS Iron Duke, HMS Vigilance, HMS Persistence, HMS Gadfly`,
            ``,
            `What each ship carries is a secret — until it sinks.`,
            ``,
            `How to play:`,
            `  • Tell me where to fire (e.g. "fire at row 3, col 7") — I'll call bs_human_fire for you`,
            `  • After your shot, the Navy returns fire via bs_claude_fire`,
            `  • Sink all 5 Navy ships to win. Don't let them sink yours.`,
            ``,
            `[Show this intro and the boards below verbatim to the human.]`,
            ``,
            renderState(bsGame),
          ].join("\n"),
        }],
      };
    }
  • The newBsState() helper function called by the handler. It places ships for both fleets randomly and returns a fresh BsState with empty attack grids, pirate first turn, and round 1.
    function newBsState(): BsState {
      const pirates = placeShipsRandom(PIRATE_SHIP_DEFS);
      const navy = placeShipsRandom(NAVY_SHIP_DEFS);
      return {
        pirateShips: pirates.ships,
        navyShips: navy.ships,
        pirateGrid: pirates.grid,
        navyGrid: navy.grid,
        pirateAttacks: emptyAttackGrid(),
        navyAttacks: emptyAttackGrid(),
        currentTurn: "pirate",
        status: "in_progress",
        roundNumber: 1,
      };
    }
  • placeShipsRandom() is the helper that places ships on an empty grid. Called by newBsState() for both pirate and navy fleets.
    function placeShipsRandom(defs: typeof PIRATE_SHIP_DEFS): { ships: ShipState[]; grid: boolean[][] } {
  • Tool registration via server.tool(). The bs_new_game tool is registered within registerBattleshipTools(), which is called from src/index.ts.
    export function registerBattleshipTools(server: McpServer): void {
      server.tool(
        "bs_new_game",
        "Start a new Battleship game: Pirates vs the Royal Navy. Both fleets are placed secretly. Each ship carries hidden cargo revealed only when sunk. Pirates fire first.",
        {},
        async () => {
          bsGame = newBsState();
          return {
            content: [{
              type: "text",
              text: [
                `⚓ PIRATES vs THE ROYAL NAVY ⚓`,
                ``,
                `The Caribbean, 1698. Your pirate fleet has spotted the Royal Navy on the horizon.`,
                `Both sides carry precious cargo. Neither knows the other's position.`,
                `Send every Navy ship to the bottom — and pray they don't do the same to you first.`,
                ``,
                `Your fleet: The Scarlet Kraken, Devil's Maw, The Widow's Wail, Bone Collector, The Rusty Nail`,
                `Their fleet: HMS Sovereign, HMS Iron Duke, HMS Vigilance, HMS Persistence, HMS Gadfly`,
                ``,
                `What each ship carries is a secret — until it sinks.`,
                ``,
                `How to play:`,
                `  • Tell me where to fire (e.g. "fire at row 3, col 7") — I'll call bs_human_fire for you`,
                `  • After your shot, the Navy returns fire via bs_claude_fire`,
                `  • Sink all 5 Navy ships to win. Don't let them sink yours.`,
                ``,
                `[Show this intro and the boards below verbatim to the human.]`,
                ``,
                renderState(bsGame),
              ].join("\n"),
            }],
          };
        }
      );
  • src/index.ts:18-18 (registration)
    The call to registerBattleshipTools(server) in the main entry point, which wires up the bs_new_game tool on the MCP server.
    registerBattleshipTools(server);
Behavior3/5

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

Discloses that fleets are placed secretly, ships have hidden cargo revealed when sunk, and pirates fire first. However, lacks information on side effects, authentication needs, or what the tool returns (no output schema or annotation). Under-disclosed for a mutation action.

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?

Description is three sentences with no wasted words. Front-loaded with the core action 'Start a new Battleship game'. Highly efficient.

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 no parameters, no annotations, and no output schema, the description provides sufficient thematic and mechanistic detail for a simple game initialization tool. Lacks return value clarity but is otherwise complete.

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?

Input schema is empty (0 parameters), so description does not need to add parameter details. Schema coverage is 100%, and description adds no redundant info. Baseline 4 is appropriate.

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?

Description clearly states the tool's purpose: start a new Battleship game. It specifies the theme (Pirates vs Royal Navy), secret fleet placement, hidden cargo, and that pirates fire first. Distinguishes from sibling tools like bs_claude_fire and bs_get_state.

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

Usage Guidelines3/5

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

Description implies usage at game start but provides no explicit guidance on when to use vs alternatives, such as not starting a new game while one is in progress. No exclusions or context for when-not-to-use.

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