opnsense_sys_backup_revert
Revert OPNsense to a previous configuration backup by specifying the backup ID. Destructive operation that replaces the running config.
Instructions
Revert OPNsense configuration to a previous backup. DESTRUCTIVE: replaces the running config with the specified backup.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| backup_id | Yes | Backup ID to revert to (e.g. 'config-1773423430.7934.xml'). Use opnsense_sys_backup_list to see available backups. |
Implementation Reference
- src/tools/system.ts:147-153 (handler)Handler for opnsense_sys_backup_revert: parses args with BackupRevertSchema, then POSTs to /core/backup/revertBackup/{backup_id} to revert configuration.
case "opnsense_sys_backup_revert": { const parsed = BackupRevertSchema.parse(args); const result = await client.post( `/core/backup/revertBackup/${encodeURIComponent(parsed.backup_id)}`, ); return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] }; } - src/tools/system.ts:14-16 (schema)BackupRevertSchema: Zod validation requiring a non-empty 'backup_id' string.
const BackupRevertSchema = z.object({ backup_id: z.string().min(1, "Backup ID is required (e.g. 'config-1773423430.7934.xml')"), }); - src/tools/system.ts:69-84 (registration)Tool definition registration: name 'opnsense_sys_backup_revert', description, and input schema with required backup_id.
{ name: "opnsense_sys_backup_revert", description: "Revert OPNsense configuration to a previous backup. DESTRUCTIVE: replaces the running config with the specified backup.", inputSchema: { type: "object" as const, properties: { backup_id: { type: "string", description: "Backup ID to revert to (e.g. 'config-1773423430.7934.xml'). Use opnsense_sys_backup_list to see available backups.", }, }, required: ["backup_id"], }, }, - src/index.ts:64-64 (registration)Registers handleSystemTool as the handler for all system tool definitions (including opnsense_sys_backup_revert) in the toolHandlers map.
for (const def of systemToolDefinitions) toolHandlers.set(def.name, handleSystemTool);