game_state
Fetch the current public state of a Minesweeper game to track progress, view board layout, and monitor remaining mines.
Instructions
Fetch the public state for a game.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| public_id | Yes |
Implementation Reference
- src/tools/handlers.ts:60-66 (handler)The handler for the 'game_state' tool, which extracts the 'public_id' from input and calls rails.getState.
async (input) => { const publicId = requireString( (input as { public_id?: unknown })?.public_id, "public_id" ); return rails.getState(publicId); } - src/tools/handlers.ts:52-58 (schema)The schema definition for the 'game_state' tool.
inputSchema: { type: "object", properties: { public_id: { type: "string" }, }, required: ["public_id"], }, - src/tools/handlers.ts:48-67 (registration)The registration of the 'game_state' tool via addTool within the createTools function.
addTool( { name: "game_state", description: "Fetch the public state for a game.", inputSchema: { type: "object", properties: { public_id: { type: "string" }, }, required: ["public_id"], }, }, async (input) => { const publicId = requireString( (input as { public_id?: unknown })?.public_id, "public_id" ); return rails.getState(publicId); } ),