Skip to main content
Glama

set_world_spawn

Set the world spawn point by modifying level.dat with specified coordinates. The server must be stopped before using this tool.

Instructions

Set the world spawn point by modifying level.dat. The server must be stopped.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
world_nameYesWorld folder name
xYesX coordinate
yYesY coordinate
zYesZ coordinate

Implementation Reference

  • Registration and implementation of the set_world_spawn MCP tool. It verifies the server is not running before using worldManager.modifyLevelDat to update the spawn coordinates.
    server.tool(
      "set_world_spawn",
      "Set the world spawn point by modifying level.dat. The server must be stopped.",
      {
        world_name: z.string().describe("World folder name"),
        x: z.number().describe("X coordinate"),
        y: z.number().describe("Y coordinate"),
        z: z.number().describe("Z coordinate"),
      },
      async ({ world_name, x, y, z: zCoord }) => {
        if (manager.isRunning()) {
          return {
            content: [
              {
                type: "text",
                text: "Cannot modify level.dat while the server is running. Use the /setworldspawn command via execute_command instead, or stop the server first.",
              },
            ],
            isError: true,
          };
        }
    
        try {
          await worldManager.modifyLevelDat(world_name, {
            SpawnX: x,
            SpawnY: y,
            SpawnZ: zCoord,
          });
          return {
            content: [
              {
                type: "text",
                text: `World spawn for "${world_name}" set to X:${x} Y:${y} Z:${zCoord}.`,
              },
            ],
          };
        } catch (error) {
          return {
            content: [
              {
                type: "text",
                text: `Error: ${error instanceof Error ? error.message : String(error)}`,
              },
            ],
            isError: true,
          };
        }
      }
    );
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations provided, so description carries full burden. Discloses critical behavioral traits: file-level modification (level.dat) and state precondition (server stopped). Does not mention side effects (e.g., affects only new players, existing logout positions) or failure modes, but covers primary safety concerns.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two sentences, zero waste. First sentence delivers purpose and mechanism; second delivers critical prerequisite. Information density is optimal with no filler.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given 100% schema coverage, no output schema, and no annotations, the description adequately covers the critical domain-specific constraint (server stopped) and persistence mechanism. Could mention spawn behavior for existing players, but sufficient for safe invocation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100% with clear descriptions for all 4 parameters. Description adds minimal semantic value beyond schema (mentions level.dat which contextualizes world_name), but baseline 3 is appropriate when schema documentation is comprehensive.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Clear specific verb (Set), resource (world spawn point), and mechanism (modifying level.dat). Distinguishes from siblings like 'teleport' (player movement) and 'set_block' (block placement) by specifying this is persistent world configuration via file modification.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Provides explicit critical constraint: 'The server must be stopped' (exclusion criterion). Lacks explicit alternatives (e.g., 'use execute_command for temporary spawn changes'), but the stopped-server warning provides essential safety context.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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