Skip to main content
Glama

ban_player

Ban players from a Minecraft server to enforce rules and maintain a safe gaming environment. Specify player name and optional reason for moderation.

Instructions

Ban a player from the server.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
playerYesPlayer name
reasonNoBan reason

Implementation Reference

  • The ban_player tool is registered and implemented in src/tools/player-tools.ts using the server.tool method. It takes a player name and an optional reason, then sends a 'ban' command via RCON.
    server.tool(
      "ban_player",
      "Ban a player from the server.",
      {
        player: z.string().describe("Player name"),
        reason: z.string().optional().describe("Ban reason"),
      },
      async ({ player, reason }) => {
        const cmd = reason ? `ban ${player} ${reason}` : `ban ${player}`;
        try {
          const response = await manager.rcon.send(cmd);
          return { content: [{ type: "text", text: response }] };
        } catch (error) {
          return {
            content: [
              {
                type: "text",
                text: `Failed: ${error instanceof Error ? error.message : String(error)}`,
              },
            ],
            isError: true,
          };
        }
      }
    );

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/tamo2918/Minecraft-Server-MCP'

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