Skip to main content
Glama
freshlife001

Texas Holdem MCP Server

by freshlife001

action_check

Perform a check action in Texas Holdem poker games by specifying the player and table IDs using the MCP server interface.

Instructions

do action check

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
player_idYes
table_idYes

Implementation Reference

  • Handler for the 'action_check' MCP tool. Sends a 'performAction' request with action 'check' to the poker server via socket.io, updates view_text with action confirmation, and appends the formatted updated table state after polling until the player is active.
    else if (request.params.name === "action_check") {
      response = await sendPokerRequest('performAction', { 
        playerId: args?.player_id,
        tableId: args?.table_id,
        action: 'check' 
      });
      view_text = `Player ${args?.player_id} action: Check\n Game state:\n`;
      
      // Get updated table state
      view_text += await pollUntilPlayerActive(args?.player_id, args?.table_id);
    } 
  • src/mcpServer.ts:78-90 (registration)
    Registration of the 'action_check' tool in the ListToolsRequestHandler response, including its description and input schema requiring player_id and table_id.
    {
      name: "action_check",
      description: "do action check",
      inputSchema: {
          type: "object",
          properties: {
            player_id: { type: "string" },
            table_id: { type: "string" },
          },
          required: ["player_id", "table_id"],
      },
    },
    {
  • Helper function used by action_check (and other tools) to send requests to the underlying poker server via socket.io.
    function sendPokerRequest(method: string, params: any): Promise<any> {
      return new Promise((resolve, reject) => {
        const request = {
          method,
          params,
          id: Date.now()
        };
        
        //console.log(`[Client] Sending request: ${method}`, params);
        
        socket.emit('action', request, (response: any) => {
          //console.log(`[Client] Received response for ${method}:`, response);
          
          if (response.error) {
            console.error(`[Client] Error in ${method}:`, response.error);
            reject(response.error);
          } else {
            resolve(response.result);
          }
        });
      });
    }
  • Helper function used by action_check (and other action tools) to poll the table state until the current player is active, then formats and returns the table state.
    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);
    }
  • Helper function to format the table state into a readable string, used in the response after action_check.
    function formatTableState(tableState: any): string {
      if (!tableState) return "No table state available.";
      
      let result = `Table: ${tableState.name} (ID: ${tableState.id})\n`;
      result += `Stage: ${tableState.stage}\n`;
      result += `Pot: $${tableState.pot}\n`;
      result += `Current Bet: $${tableState.currentBet}\n`;
      
      // Find the current active player
      const currentPlayer = tableState.players.find((p: any) => p.isActive);
      if (currentPlayer) {
        result += `Current Player: ${currentPlayer.name} (ID: ${currentPlayer.id})\n`;
      }
      
      // Community cards
      result += `Community Cards: ${tableState.communityCards.join(', ') || 'None'}\n\n`;
      
      // Players
      result += "Players:\n";
      tableState.players.forEach((player: any) => {
        result += `- ${player.name}: $${player.chips} chips`;
        
        if (player.isDealer) result += " (Dealer)";
        if (player.isSmallBlind) result += " (Small Blind)";
        if (player.isBigBlind) result += " (Big Blind)";
        if (player.isActive) result += " (Active)";
        if (player.folded) result += " (Folded)";
        if (player.isAllIn) result += " (All-In)";
        
        result += ` - Bet: $${player.bet}\n`;
        
        // Show hand if available
        if (player.hand && player.hand.length > 0) {
          result += `  Hand: ${player.hand.join(', ')}\n`;
        }
      });
      
      return result;
    }
Behavior1/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure but fails completely. 'do action check' doesn't reveal whether this is a read or write operation, what permissions are required, what side effects occur, or what the tool returns. For a tool with 2 required parameters and no annotation coverage, this is a critical deficiency.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness2/5

Is the description appropriately sized, front-loaded, and free of redundancy?

While technically concise with just three words, this is a case of under-specification rather than effective conciseness. The description fails to communicate essential information, making it inefficient rather than efficient. It doesn't follow the principle of front-loading key information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness1/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool has 2 required parameters, no annotations, no output schema, and 0% schema description coverage, the description is completely inadequate. It provides no meaningful information about what the tool does, when to use it, what parameters mean, or what behavior to expect. This is insufficient for any practical use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters1/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema description coverage is 0%, meaning neither parameter (player_id, table_id) has any documentation in the schema. The description 'do action check' provides zero information about what these parameters mean, what format they should be in, or how they relate to the tool's function. This leaves both required parameters completely undocumented.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose1/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'do action check' is a tautology that merely restates the tool name 'action_check' without adding any meaningful information about what the tool actually does. It doesn't specify what resource is being acted upon or what 'check' means in this context, making it completely unhelpful for understanding the tool's purpose.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines1/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides absolutely no guidance about when to use this tool versus the 7 sibling tools (action_bet, action_call, action_fold, action_raise, get_table_status, join_table, leave_table, login). There's no indication of what context triggers this tool, what prerequisites exist, or how it differs from other action-related tools.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Related Tools

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/freshlife001/mcp_poker'

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