Skip to main content
Glama
freshlife001

Texas Holdem MCP Server

by freshlife001

join_table

Enable AI agents to join a Texas Holdem poker table by specifying player and table IDs using this MCP server tool for seamless game participation.

Instructions

Join a poker table

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
player_idYes
table_idYes

Implementation Reference

  • Input schema for the 'join_table' MCP tool, defining required player_id and table_id parameters.
      name: "join_table",
      description: "Join a poker table",
      inputSchema: {
        type: "object",
        properties: {
          player_id: { type: "string" },
          table_id: { type: "string" },
        },
        required: ["player_id", "table_id"],
      },
    },
  • MCP CallTool handler for 'join_table': sends 'joinTable' request to PokerServer via socket.io and appends formatted table state after polling for active player turn.
    else if (request.params.name === "join_table") {
      response = await sendPokerRequest('joinTable', { 
        playerId: args?.player_id,
        tableId: args?.table_id
      });
      view_text = `Player ${args?.player_id} joined table ${args?.table_id}.\n Game state:\n`;
      
      // Get table state after joining
      view_text += await pollUntilPlayerActive(args?.player_id, args?.table_id);
    } 
  • Tool registration in ListToolsRequestHandler, including 'join_table' in the list of available tools with schema.
      return {
        tools: [
          {
            name: "login",
            description: "login and list all tables in the poker game",
            inputSchema: {
              type: "object",
              properties: {
                name: { type: "string" },
              },
              required: ['name'],
            },
          },
          {
            name: "join_table",
            description: "Join a poker table",
            inputSchema: {
              type: "object",
              properties: {
                player_id: { type: "string" },
                table_id: { type: "string" },
              },
              required: ["player_id", "table_id"],
            },
          },
          {
            name: "get_table_status",
            description: "Get the current status of a poker table",
            inputSchema: {
              type: "object",
              properties: {
                player_id: { type: "string" },
                table_id: { type: "string" },
              },
              required: ["player_id", "table_id"],
            },
          },
          {
            name: "leave_table",
            description: "Leave a poker table",
            inputSchema: {
                type: "object",
                properties: {
                  player_id: { type: "string" },
                  table_id: { type: "string" },
                },
                required: ["player_id", "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"],
            },
          },
          {
            name: "action_fold",
            description: "do action fold",
            inputSchema: {
                type: "object",
                properties: {
                  player_id: { type: "string" },
                  table_id: { type: "string" },
                },
                required: ["player_id", "table_id"],
            },
          },
          {
            name: "action_bet",
            description: "do action bet",
            inputSchema: {
              type: "object",
              properties: {
                player_id: { type: "string" },
                table_id: { type: "string" },
                amount: { type: "number" },
              },
              required: ["player_id", "table_id", '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'],
            },
          },
          {
            name: "action_call",
            description: "do action call",
            inputSchema: {
                type: "object",
                properties: {
                  player_id: { type: "string" },
                  table_id: { type: "string" },
                },
                required: ["player_id", "table_id"],
            },
          },
        ],
      };
    });
  • PokerServer.handleJoinTable: Validates params, retrieves player, calls GameManager.joinTable, returns success response.
    private handleJoinTable(params: any, id: string | number): PokerResponse {
      const { playerId, tableId } = params;
      
      if (!playerId || !tableId) {
        return {
          error: {
            code: -32602,
            message: 'Invalid params: playerId and tableId are required'
          },
          id
        };
      }
      
      const player = this.players.get(playerId);
      if (!player) {
        return {
          error: {
            code: -32602,
            message: `Player with ID ${playerId} not found`
          },
          id
        };
      }
      
      const success = this.gameManager.joinTable(tableId, player);
      if (!success) {
        return {
          error: {
            code: -32603,
            message: `Failed to join table ${tableId}`
          },
          id
        };
      }
      
      return {
        result: {
          success: true,
          tableId,
          playerId
        },
        id
      };
    }
  • GameManager.joinTable: Adds player to table after checking/leaving current table, updates player-table mapping.
    joinTable(tableId: string, player: Player): boolean {
      const table = this.tables.get(tableId);
      if (!table) {
        return false;
      }
      
      // Check if player is already at a table
      if (this.playerTables.has(player.id)) {
        const currentTableId = this.playerTables.get(player.id);
        if (currentTableId === tableId) {
          return true; // Player is already at this table
        }
        
        // Leave current table first
        this.leaveTable(player.id);
      }
      
      const success = table.addPlayer(player);
      if (success) {
        this.playerTables.set(player.id, tableId);
      }
      
      return success;
    }
Behavior2/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. It states the action but doesn't reveal any behavioral traits—such as whether joining requires specific permissions, if it's idempotent, what happens on success/failure, or any rate limits. This leaves critical operational details unspecified.

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

Conciseness5/5

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

The description is extremely concise—just three words—and front-loaded with the core action. There's no wasted text, making it easy to parse quickly. However, this brevity comes at the cost of completeness, but for conciseness alone, it's optimal.

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

Completeness2/5

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

Given the tool's complexity (a mutating action with 2 parameters), lack of annotations, no output schema, and 0% schema description coverage, the description is incomplete. It doesn't cover parameter meanings, behavioral outcomes, or usage context, leaving significant gaps for an agent to operate effectively.

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

Parameters2/5

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

The input schema has 2 parameters with 0% description coverage, so the schema provides no semantic context. The description adds no meaning beyond the tool name—it doesn't explain what 'player_id' and 'table_id' represent, their formats, or how they relate to the join operation. This fails to compensate for the low schema coverage.

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

Purpose3/5

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

The description 'Join a poker table' clearly states the action (join) and resource (poker table), but it's somewhat vague about what 'join' entails—does it mean entering a game, sitting at a seat, or something else? It distinguishes from siblings like 'leave_table' but not from other table-related tools like 'get_table_status', leaving room for improvement in specificity.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives. For example, it doesn't mention prerequisites (e.g., needing to be logged in via 'login' first) or when to choose this over other actions like 'action_bet'. This lack of context makes it harder for an agent to decide appropriately.

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