Skip to main content
Glama

server_rename_file

Rename or move files and directories on a Minecraft server by specifying the server ID, current path, and new name.

Instructions

Rename or move a file or directory on a Minecraft server

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
server_idYesServer ID or UUID
pathYesCurrent relative file path
new_nameYesNew file/directory name

Implementation Reference

  • The tool "server_rename_file" is registered and handled within the `registerServerFileTools` function in `src/tools/server-files.ts`. It takes `server_id`, `path`, and `new_name` as input parameters and executes a patch request to the server's file management endpoint.
    server.tool(
      "server_rename_file",
      "Rename or move a file or directory on a Minecraft server",
      {
        server_id: z.string().describe("Server ID or UUID"),
        path: z.string().describe("Current relative file path"),
        new_name: z.string().describe("New file/directory name"),
      },
      async ({ server_id, path, new_name }) => {
        try {
          const data = await client.patch(`/servers/${server_id}/files/create`, {
            path,
            new_name,
          });
          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 };
        }
      }
    );

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