Skip to main content
Glama

server_delete_file

Remove files or directories from a Minecraft server to manage storage and clean up unnecessary data. Specify server ID and file paths to delete.

Instructions

Delete one or more files or directories from a Minecraft server

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
server_idYesServer ID or UUID
pathsYesArray of relative file paths to delete

Implementation Reference

  • The server_delete_file tool implementation, which accepts server_id and an array of paths to delete from the Minecraft server. It uses the client to perform a DELETE request.
    server.tool(
      "server_delete_file",
      "Delete one or more files or directories from a Minecraft server",
      {
        server_id: z.string().describe("Server ID or UUID"),
        paths: z.array(z.string()).describe("Array of relative file paths to delete"),
      },
      async ({ server_id, paths }) => {
        try {
          const file_system_objects = paths.map((filename) => ({ filename }));
          const data = await client.delete(`/servers/${server_id}/files`, {
            file_system_objects,
          });
          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