action_raise
Enables a player to increase their bet in Texas Holdem poker by specifying player ID, table ID, and raise amount. Facilitates strategic gameplay within the MCP server.
Instructions
do action raise
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| amount | Yes | ||
| player_id | Yes | ||
| table_id | Yes |
Implementation Reference
- src/mcpServer.ts:278-289 (handler)Executes the action_raise tool by calling sendPokerRequest with 'performAction', action='raise', and the provided amount, player_id, table_id. Then polls for the updated table state using pollUntilPlayerActive and formats the response.else if (request.params.name === "action_raise") { response = await sendPokerRequest('performAction', { playerId: args?.player_id, tableId: args?.table_id, action: 'raise', amount: args?.amount }); view_text = `Player ${args?.player_id} action: Raise to $${args?.amount}\n Game state:\n`; // Get updated table state view_text += await pollUntilPlayerActive(args?.player_id, args?.table_id); }
- src/mcpServer.ts:115-127 (registration)Registers the action_raise tool in the ListTools response, including name, description, and input schema requiring player_id, table_id, and amount.{ name: "action_raise", description: "do action raise", inputSchema: { type: "object", properties: { player_id: { type: "string" }, table_id: { type: "string" }, amount: { type: "number" }, }, required: ["player_id", "table_id", 'amount'], }, },
- src/mcpServer.ts:118-126 (schema)Input schema for action_raise: object with player_id (string), table_id (string), amount (number), all required.inputSchema: { type: "object", properties: { player_id: { type: "string" }, table_id: { type: "string" }, amount: { type: "number" }, }, required: ["player_id", "table_id", 'amount'], },
- src/mcpServer.ts:148-173 (helper)Helper function used by action_raise (and others) to poll the table state until the player is active, then formats it.async function pollUntilPlayerActive(player_id:unknown, table_id:unknown) { let tableState = null; let counter = 0; while(true) { tableState = await sendPokerRequest('getTableState', { playerId: player_id, tableId: table_id }); counter ++; if (counter > 120) { break } const currentPlayer = tableState.players.find((p: any) => p.isActive); if (currentPlayer && currentPlayer.id === player_id) { break; } await sleep(1000); } if (tableState === null) { return ''; } return formatTableState(tableState); }