server_decompress_file
Decompress archive files on a Minecraft server to extract game files, mods, or configurations using the crafty-mcp server tool.
Instructions
Decompress/unzip an archive file on 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>",
"folder": "<folder>"
},
"name": "server_decompress_file"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| server_id | Yes | Server ID or UUID | |
| folder | Yes | Relative path to the archive file to decompress |
Implementation Reference
- src/tools/server-files.ts:158-174 (handler)The tool "server_decompress_file" is registered and handled within the `registerServerFileTools` function in `src/tools/server-files.ts`. It takes `server_id` and `folder` (path to archive) as inputs and sends a POST request to `/servers/${server_id}/files/zip`.
server.tool( "server_decompress_file", "Decompress/unzip an archive file on a Minecraft server", { server_id: z.string().describe("Server ID or UUID"), folder: z.string().describe("Relative path to the archive file to decompress"), }, async ({ server_id, folder }) => { try { const data = await client.post(`/servers/${server_id}/files/zip`, { folder }); 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 }; } } );