Skip to main content
Glama

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
NameRequiredDescriptionDefault
backup_nameYesBackup name to delete
confirmYesMust be true to confirm deletion

Implementation Reference

  • 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;
  • 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.` },
          ],

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/tamo2918/Minecraft-Server-MCP'

If you have feedback or need assistance with the MCP directory API, please join our Discord server