whitelist_manage
Manage Minecraft server whitelist to control player access. Add or remove players, toggle whitelist status, and list current whitelisted users for server security.
Instructions
Manage the server whitelist.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| action | Yes | Whitelist action | |
| player | No | Player name (required for add/remove) |
Implementation Reference
- src/tools/player-tools.ts:167-213 (handler)The tool 'whitelist_manage' is registered and implemented in src/tools/player-tools.ts. It uses the server.tool method to define the schema and the async handler to process whitelist actions via RCON commands.
server.tool( "whitelist_manage", "Manage the server whitelist.", { action: z .enum(["add", "remove", "list", "on", "off", "reload"]) .describe("Whitelist action"), player: z .string() .optional() .describe("Player name (required for add/remove)"), }, async ({ action, player }) => { let cmd: string; if (action === "add" || action === "remove") { if (!player) { return { content: [ { type: "text", text: `Player name is required for whitelist ${action}.`, }, ], isError: true, }; } cmd = `whitelist ${action} ${player}`; } else { cmd = `whitelist ${action}`; } 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, }; } } );