Skip to main content
Glama

list_worlds

Lists all Minecraft worlds in the server directory with their file sizes for inventory management and storage optimization.

Instructions

List all Minecraft worlds in the server directory with their sizes.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The `list_worlds` tool registration and handler implementation. It uses `worldManager.listWorlds()` to fetch the worlds and formats the output.
    server.tool(
      "list_worlds",
      "List all Minecraft worlds in the server directory with their sizes.",
      {},
      async () => {
        const worlds = worldManager.listWorlds();
        if (worlds.length === 0) {
          return {
            content: [
              {
                type: "text",
                text: "No worlds found. Start the server to generate one, or use setup_world to configure generation settings.",
              },
            ],
          };
        }
    
        const lines: string[] = [];
        for (const name of worlds) {
          const size = worldManager.getWorldSize(name);
          const info = await worldManager.getWorldInfo(name).catch(() => null);
          const details = info
            ? ` | Seed: ${info.seed} | GameType: ${["Survival", "Creative", "Adventure", "Spectator"][info.gameType] ?? info.gameType} | Spawn: ${info.spawnX},${info.spawnY},${info.spawnZ}`
            : "";
          lines.push(`📁 ${name} (${size.toFixed(1)} MB)${details}`);
        }
        return { content: [{ type: "text", text: lines.join("\n") }] };
      }
    );

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