Skip to main content
Glama

server_create_directory

Create a new directory on a Minecraft server by specifying server ID, parent path, and directory name to organize server files.

Instructions

Create a new directory on a Minecraft server

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
server_idYesServer ID or UUID
parentYesParent directory path
nameYesNew directory name

Implementation Reference

  • The handler function for the server_create_directory tool, which makes a PUT request to the server API to create a directory.
    async ({ server_id, parent, name }) => {
      try {
        const data = await client.put(`/servers/${server_id}/files/create`, {
          parent,
          name,
          directory: true,
        });
        return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] };
      } catch (error) {
        const msg = error instanceof Error ? error.message : String(error);
        return { content: [{ type: "text", text: `Error: ${msg}` }], isError: true };
      }
  • The registration block for the server_create_directory tool using the MCP server instance.
    server.tool(
      "server_create_directory",
      "Create a new directory on a Minecraft server",
      {
        server_id: z.string().describe("Server ID or UUID"),
        parent: z.string().describe("Parent directory path"),
        name: z.string().describe("New directory name"),
      },

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/HadiCherkaoui/crafty-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server