Skip to main content
Glama
freshlife001

Texas Holdem MCP Server

by freshlife001

leave_table

Use this tool to exit a poker table on the Texas Holdem MCP Server by specifying the player ID and table ID to remove a player from the game.

Instructions

Leave a poker table

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
player_idYes
table_idYes

Implementation Reference

  • MCP tool handler for 'leave_table': invokes internal 'leaveTable' RPC on PokerServer with playerId and tableId, sets response text.
    else if (request.params.name === "leave_table") {
      response = await sendPokerRequest('leaveTable', {
        playerId: args?.player_id,
        tableId: args?.table_id
      });
      view_text = `Player ${args?.player_id} left table ${args?.table_id}. Game state:\n`;
    } 
  • Input schema for 'leave_table' tool as defined in the listTools response.
    {
      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"],
      },
    },
  • Tool registration in the ListToolsRequest handler, including 'leave_table' among other tools.
      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 RPC handler for 'leaveTable', called by MCP tool. Validates playerId and calls GameManager.leaveTable.
    private handleLeaveTable(params: any, id: string | number): PokerResponse {
      const { playerId } = params;
      
      if (!playerId) {
        return {
          error: {
            code: -32602,
            message: 'Invalid params: playerId is required'
          },
          id
        };
      }
      
      const success = this.gameManager.leaveTable(playerId);
      
      return {
        result: {
          success
        },
        id
      };
    }
  • GameManager method implementing table leaving logic: finds player's table and removes them from it.
    leaveTable(playerId: string): boolean {
      const tableId = this.playerTables.get(playerId);
      if (!tableId) {
        return false;
      }
      
      const table = this.tables.get(tableId);
      if (!table) {
        this.playerTables.delete(playerId);
        return false;
      }
      
      const success = table.removePlayer(playerId);
      if (success) {
        this.playerTables.delete(playerId);
        
        // Comment out or remove this code that deletes empty tables
        // If table is empty, remove it
        // if (table.players.length === 0) {
        //   this.tables.delete(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 full burden for behavioral disclosure. 'Leave a poker table' implies a mutation (player exiting), but it doesn't describe effects (e.g., forfeits chips, ends participation), permissions, or error conditions. This is a significant gap for a mutation tool with zero annotation coverage.

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 a single, efficient sentence with zero waste. It is appropriately sized and front-loaded, making it easy to parse quickly without unnecessary elaboration.

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 a mutation tool with 2 parameters, 0% schema coverage, no annotations, and no output schema, the description is incomplete. It lacks details on behavior, parameters, and outcomes, failing to provide enough context for reliable tool invocation.

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?

Schema description coverage is 0%, so the description must compensate for undocumented parameters. It adds no meaning beyond the schema, failing to explain what 'player_id' and 'table_id' represent or their format (e.g., UUIDs, names). This leaves parameters semantically unclear.

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 'Leave a poker table' clearly states the action (leave) and target resource (poker table), providing basic purpose. However, it doesn't differentiate from sibling tools like 'join_table' or specify what 'leave' entails beyond the verb itself, making it somewhat vague.

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?

No guidance is provided on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., must be at a table), exclusions (e.g., cannot leave during active hand), or relationships with siblings like 'join_table' or action tools, leaving the agent with no usage context.

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