delete_backup
Remove specified backup files from the Memory MCP Server to manage storage and maintain organized memory systems.
Instructions
刪除指定的備份文件
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| backup_path | Yes | 備份文件路徑 |
Implementation Reference
- src/tools/backup-tools.js:256-276 (handler)The handler function that implements the delete_backup tool logic. It destructures the backup_path from args, verifies file existence with fs.access, deletes the file using fs.unlink, and returns a success response with the deleted path or an error message.async handler(args) { const { backup_path } = args; try { // 確保文件存在 await fs.access(backup_path); // 刪除文件 await fs.unlink(backup_path); return { success: true, deleted_file: backup_path }; } catch (error) { return { success: false, error: error.message }; } }
- src/tools/backup-tools.js:253-255 (schema)The Zod input schema defining the required backup_path parameter as a string.inputSchema: z.object({ backup_path: z.string().describe('備份文件路徑') }),
- src/index.js:161-162 (registration)Initial registration of all backup tools, including delete_backup, by calling createBackupTools and adding them to the toolRegistry with 'backup' scope.const backupTools = createBackupTools(getShortTermManager, getLongTermManager, getStorageManager); backupTools.forEach(tool => registerTool(tool, 'backup'));