Skip to main content
Glama

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
NameRequiredDescriptionDefault
commandsYesArray of commands to execute in order (without leading '/')

Implementation Reference

  • 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,
          };
        }
      }
    );

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