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
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"server_id": "<server_id>",
"paths": "<paths>"
},
"name": "server_delete_file"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| server_id | Yes | Server ID or UUID | |
| paths | Yes | Array of relative file paths to delete |
Implementation Reference
- src/tools/server-files.ts:69-88 (handler)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 }; } } );