Skip to main content
Glama
Vic563

Minesweeper MCP Server

by Vic563

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
NameRequiredDescriptionDefault
boardIdYesID of the board to delete

Implementation Reference

  • 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.`,
          },
        ],
      };
    }
  • Core implementation of board deletion: removes the board from the internal boards Map.
    deleteBoard(boardId: string): boolean {
      return this.boards.delete(boardId);
    }
  • 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[],
      };
    });

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/Vic563/mindsweeper-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server