Skip to main content
Glama

delete_world

Delete Minecraft world folders permanently when the server is stopped. Requires confirmation to prevent accidental data loss. Always create backups before using this irreversible action.

Instructions

Delete a world folder. WARNING: This is irreversible! Consider creating a backup first. The server must be stopped.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
world_nameYesWorld folder name to delete
confirmYesMust be true to confirm deletion

Implementation Reference

  • The `delete_world` tool handler logic, which checks for the confirmation flag and server status before calling the `WorldManager` to perform the deletion.
    server.tool(
      "delete_world",
      "Delete a world folder. WARNING: This is irreversible! Consider creating a backup first. The server must be stopped.",
      {
        world_name: z.string().describe("World folder name to delete"),
        confirm: z
          .boolean()
          .describe("Must be true to confirm deletion"),
      },
      async ({ world_name, confirm }) => {
        if (!confirm) {
          return {
            content: [
              {
                type: "text",
                text: "Deletion cancelled. Set confirm=true to proceed.",
              },
            ],
          };
        }
    
        if (manager.isRunning()) {
          return {
            content: [
              {
                type: "text",
                text: "Cannot delete a world while the server is running. Stop the server first.",
              },
            ],
            isError: true,
          };
        }
    
        try {
          const deleted = worldManager.deleteWorld(world_name);
          if (deleted) {
            return {
              content: [
                {
                  type: "text",
                  text: `World "${world_name}" has been deleted.`,
                },
              ],
            };
          }
          return {
            content: [
              { type: "text", text: `World "${world_name}" not found.` },
            ],
            isError: true,
          };
        } catch (error) {
          return {
            content: [
              {
                type: "text",
                text: `Error: ${error instanceof Error ? error.message : String(error)}`,
              },
            ],
            isError: true,
          };
        }
      }
  • Registration of the `delete_world` tool name in the MCP server.
    "delete_world",
  • The underlying `WorldManager.deleteWorld` method that performs the actual file system deletion.
    deleteWorld(worldName: string): boolean {
      // Safety: prevent path traversal

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