Skip to main content
Glama

get_world_info

Retrieve world details from Minecraft server level.dat files, including seed, spawn coordinates, game type, and version information for server administration.

Instructions

Get detailed information about a world from its level.dat file, including seed, spawn point, game type, and version.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
world_nameYesWorld folder name (e.g., 'world')

Implementation Reference

  • The 'get_world_info' tool is defined here, with its input schema and handler logic. It retrieves world information using the worldManager service.
    // --- Get World Info ---
    server.tool(
      "get_world_info",
      "Get detailed information about a world from its level.dat file, including seed, spawn point, game type, and version.",
      {
        world_name: z.string().describe("World folder name (e.g., 'world')"),
      },
      async ({ world_name }) => {
        const info = await worldManager.getWorldInfo(world_name);
        if (!info) {
          return {
            content: [
              { type: "text", text: `World "${world_name}" not found.` },
            ],
            isError: true,
          };
        }
    
        const structure = worldManager.getWorldStructure(world_name);
        const size = worldManager.getWorldSize(world_name);
        const datapacks = worldManager.listDataPacks(world_name);
    
        const gameTypes = ["Survival", "Creative", "Adventure", "Spectator"];
        const difficulties = ["Peaceful", "Easy", "Normal", "Hard"];
    
        const lines = [
          `World: ${info.levelName} (${world_name})`,
          `Version: ${info.version ?? "Unknown"}`,
          `Data Version: ${info.dataVersion ?? "Unknown"}`,
          `Size: ${size.toFixed(1)} MB`,
          ``,
          `--- Generation ---`,
          `Seed: ${info.seed}`,
          `Game Type: ${gameTypes[info.gameType] ?? info.gameType}`,
          `Difficulty: ${difficulties[info.difficulty] ?? info.difficulty}`,
          `Hardcore: ${info.hardcore}`,
          ``,
          `--- Spawn Point ---`,
          `X: ${info.spawnX}, Y: ${info.spawnY}, Z: ${info.spawnZ}`,
          ``,
          `--- Time ---`,
          `Day Time: ${info.dayTime} ticks (Day ${Math.floor(info.dayTime / 24000)})`,
          `Last Played: ${info.lastPlayed > 0 ? new Date(Number(info.lastPlayed)).toISOString() : "Unknown"}`,
          ``,
          `--- Structure ---`,
          ...Object.entries(structure).map(
            ([name, exists]) => `  ${exists ? "✅" : "❌"} ${name}`
          ),
          ``,
          `--- Data Packs ---`,
          datapacks.length > 0 ? datapacks.join(", ") : "None",
        ];
        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