execute_commands
Execute multiple Minecraft commands sequentially via RCON to perform batch operations such as building structures or setting up game scenarios.
Instructions
Execute multiple Minecraft commands sequentially via RCON. Useful for batch operations like building structures or setting up game scenarios.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| commands | Yes | Array of commands to execute in order (without leading '/') |
Implementation Reference
- src/tools/command-tools.ts:47-74 (handler)The `execute_commands` tool handler implementation, which uses `manager.rcon.sendMultiple` to execute a list of commands sequentially.
server.tool( "execute_commands", "Execute multiple Minecraft commands sequentially via RCON. Useful for batch operations like building structures or setting up game scenarios.", { commands: z .array(z.string()) .describe("Array of commands to execute in order (without leading '/')"), }, async ({ commands }) => { try { const results = await manager.rcon.sendMultiple(commands); const lines = results.map( (r) => `> ${r.command}\n ${r.response || "(no response)"}` ); return { content: [{ type: "text", text: lines.join("\n\n") }] }; } catch (error) { return { content: [ { type: "text", text: `Failed to execute commands: ${error instanceof Error ? error.message : String(error)}`, }, ], isError: true, }; } } );