Skip to main content
Glama

server_update_backup_config

Modify backup settings for Minecraft servers by adjusting retention limits, compression, pre/post commands, and directory exclusions.

Instructions

Update backup configuration for a Minecraft server

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
server_idYesServer ID or UUID
backup_nameNoBackup configuration name
max_backupsNoMaximum number of backups to keep
compressNoCompress backups
shutdownNoShut down server before backup
beforeNoCommand to run before backup
afterNoCommand to run after backup
excluded_dirsNoDirectories to exclude from backup

Implementation Reference

  • The tool "server_update_backup_config" is defined and implemented within the `registerServerBackupTools` function in `src/tools/server-backups.ts`. The handler uses the `CraftyClient` to send a PATCH request to the server's backup configuration endpoint.
    server.tool(
      "server_update_backup_config",
      "Update backup configuration for a Minecraft server",
      {
        server_id: z.string().describe("Server ID or UUID"),
        backup_name: z.string().min(3).optional().describe("Backup configuration name"),
        max_backups: z.number().optional().describe("Maximum number of backups to keep"),
        compress: z.boolean().optional().describe("Compress backups"),
        shutdown: z.boolean().optional().describe("Shut down server before backup"),
        before: z.string().optional().describe("Command to run before backup"),
        after: z.string().optional().describe("Command to run after backup"),
        excluded_dirs: z.array(z.string()).optional().describe("Directories to exclude from backup"),
      },
      async ({ server_id, ...updates }) => {
        try {
          const data = await client.patch(`/servers/${server_id}/backups/config`, updates);
          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