delete_backup
Remove old or unnecessary backup files from a Minecraft server to free up storage space and maintain organized backup management.
Instructions
Delete a backup file.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| backup_name | Yes | Backup name to delete | |
| confirm | Yes | Must be true to confirm deletion |
Implementation Reference
- src/core/BackupManager.ts:165-173 (handler)The actual logic implementation that deletes the backup file from the filesystem.
deleteBackup(backupName: string): boolean { const tarName = backupName.endsWith(".tar.gz") ? backupName : `${backupName}.tar.gz`; const backupPath = path.join(this.backupDir, tarName); if (!fs.existsSync(backupPath)) return false; fs.unlinkSync(backupPath); return true; - src/tools/backup-tools.ts:150-180 (registration)Tool definition and wrapper function that invokes BackupManager.deleteBackup and handles response formatting for MCP.
server.tool( "delete_backup", "Delete a backup file.", { backup_name: z.string().describe("Backup name to delete"), confirm: z.boolean().describe("Must be true to confirm deletion"), }, async ({ backup_name, confirm }) => { if (!confirm) { return { content: [ { type: "text", text: "Deletion cancelled. Set confirm=true to proceed.", }, ], }; } const deleted = backupManager.deleteBackup(backup_name); if (deleted) { return { content: [ { type: "text", text: `Backup "${backup_name}" deleted.` }, ], }; } return { content: [ { type: "text", text: `Backup "${backup_name}" not found.` }, ],