list_boards
Retrieve all active Minesweeper game boards to track ongoing games and manage gameplay sessions.
Instructions
List all active Minesweeper boards
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "list_boards"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:257-292 (handler)The main handler for the 'list_boards' tool within the CallToolRequestSchema switch statement. It calls game.getAllBoards(), formats a descriptive list of active boards including dimensions, mine count, game state, and duration if finished, and returns formatted text content.
case 'list_boards': { const boards = this.game.getAllBoards(); if (boards.length === 0) { return { content: [ { type: 'text', text: 'No active Minesweeper boards found.', }, ], }; } let message = `Active Minesweeper Boards (${boards.length}):\n\n`; for (const board of boards) { const duration = board.endTime ? Math.round((board.endTime - board.startTime) / 1000) : Math.round((Date.now() - board.startTime) / 1000); message += `• ${board.id}: ${board.width}x${board.height}, ${board.mineCount} mines, ${board.gameState}`; if (board.gameState !== 'playing') { message += ` (${duration}s)`; } message += '\n'; } return { content: [ { type: 'text', text: message, }, ], }; } - src/index.ts:142-149 (schema)The tool definition including name, description, and input schema (empty object since no parameters) as part of the tools list returned by ListToolsRequestHandler.
{ name: 'list_boards', description: 'List all active Minesweeper boards', inputSchema: { type: 'object', properties: {}, }, }, - src/minesweeper.ts:212-214 (helper)Supporting method in MinesweeperGame class that retrieves and returns an array of all active GameBoard instances stored in the internal Map.
getAllBoards(): GameBoard[] { return Array.from(this.boards.values()); }