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
| Name | Required | Description | Default |
|---|---|---|---|
| server_id | Yes | Server ID or UUID | |
| path | Yes | Current relative file path | |
| new_name | Yes | New file/directory name |
Implementation Reference
- src/tools/server-files.ts:136-156 (handler)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 }; } } );