delete_board
Remove a Minesweeper board from the game server by specifying its unique board ID to manage your saved games.
Instructions
Delete a Minesweeper board
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| boardId | Yes | ID of the board to delete |
Implementation Reference
- src/index.ts:294-308 (handler)MCP tool handler for 'delete_board': extracts boardId from arguments, calls MinesweeperGame.deleteBoard, and returns success/error text response.case 'delete_board': { const { boardId } = args as { boardId: string }; const deleted = this.game.deleteBoard(boardId); return { content: [ { type: 'text', text: deleted ? `Successfully deleted board '${boardId}'.` : `Board '${boardId}' not found.`, }, ], }; }
- src/minesweeper.ts:216-218 (handler)Core implementation of board deletion: removes the board from the internal boards Map.deleteBoard(boardId: string): boolean { return this.boards.delete(boardId); }
- src/index.ts:150-163 (schema)Tool schema definition: specifies name, description, and input schema requiring a 'boardId' string.{ name: 'delete_board', description: 'Delete a Minesweeper board', inputSchema: { type: 'object', properties: { boardId: { type: 'string', description: 'ID of the board to delete', }, }, required: ['boardId'], }, },
- src/index.ts:46-166 (registration)Registers all tools including 'delete_board' by handling ListToolsRequestSchema and returning the tools list.this.server.setRequestHandler(ListToolsRequestSchema, async () => { return { tools: [ { name: 'create_board', description: 'Create a new Minesweeper board with specified dimensions and mine count', inputSchema: { type: 'object', properties: { id: { type: 'string', description: 'Unique identifier for the board', }, width: { type: 'number', description: 'Width of the board (number of columns)', minimum: 1, maximum: 50, }, height: { type: 'number', description: 'Height of the board (number of rows)', minimum: 1, maximum: 50, }, mineCount: { type: 'number', description: 'Number of mines to place on the board', minimum: 0, }, }, required: ['id', 'width', 'height', 'mineCount'], }, }, { name: 'reveal_cell', description: 'Reveal a cell on the Minesweeper board', inputSchema: { type: 'object', properties: { boardId: { type: 'string', description: 'ID of the board', }, x: { type: 'number', description: 'X coordinate (column) of the cell to reveal', minimum: 0, }, y: { type: 'number', description: 'Y coordinate (row) of the cell to reveal', minimum: 0, }, }, required: ['boardId', 'x', 'y'], }, }, { name: 'flag_cell', description: 'Flag or unflag a cell on the Minesweeper board', inputSchema: { type: 'object', properties: { boardId: { type: 'string', description: 'ID of the board', }, x: { type: 'number', description: 'X coordinate (column) of the cell to flag', minimum: 0, }, y: { type: 'number', description: 'Y coordinate (row) of the cell to flag', minimum: 0, }, }, required: ['boardId', 'x', 'y'], }, }, { name: 'get_board', description: 'Get the current state and visual representation of a Minesweeper board', inputSchema: { type: 'object', properties: { boardId: { type: 'string', description: 'ID of the board to display', }, }, required: ['boardId'], }, }, { name: 'list_boards', description: 'List all active Minesweeper boards', inputSchema: { type: 'object', properties: {}, }, }, { name: 'delete_board', description: 'Delete a Minesweeper board', inputSchema: { type: 'object', properties: { boardId: { type: 'string', description: 'ID of the board to delete', }, }, required: ['boardId'], }, }, ] as Tool[], }; });