gepa_list_backups
Retrieve and manage system backups with optional filters, ensuring accessible and organized data for the Prompt Auto-Optimizer MCP server. Use limit and label filters to streamline backup selection.
Instructions
List available system backups
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| filterLabel | No | Filter backups by label (optional) | |
| limit | No | Maximum number of backups to return |
Implementation Reference
- src/mcp/server.ts:1538-1598 (handler)The core handler function for 'gepa_list_backups' tool. It initializes disaster recovery, simulates listing backups with mock data filtered by limit and label, formats a markdown response listing available backups with details like ID, timestamp, size, etc.private async listBackups(params: { limit?: number; filterLabel?: string; }): Promise<{ content: { type: string; text: string; }[] }> { const { limit = 20, filterLabel } = params; try { await this.disasterRecovery.initialize(); // This would ideally be a method on the disaster recovery system // For now, we'll simulate the response const mockBackups = [ { id: 'backup_1733140800_abc123', timestamp: new Date(), label: 'manual-backup', type: 'full', size: 5242880, components: 3 }, { id: 'backup_1733137200_def456', timestamp: new Date(Date.now() - 3600000), label: 'auto-backup', type: 'incremental', size: 1048576, components: 2 } ]; let backups = mockBackups; if (filterLabel) { backups = backups.filter(b => b.label?.includes(filterLabel)); } backups = backups.slice(0, limit); return { content: [ { type: 'text', text: `# Available System Backups Found ${backups.length} backup(s): ${backups.map(backup => `## ${backup.label || 'Unlabeled'} (${backup.id}) - **Created**: ${backup.timestamp.toISOString()} - **Type**: ${backup.type} - **Size**: ${(backup.size / 1024 / 1024).toFixed(2)} MB - **Components**: ${backup.components} `).join('\n')} ${backups.length === 0 ? 'No backups found matching the criteria.' : `Use \`gepa_restore_backup\` with a backup ID to restore the system.`}`, }, ], }; } catch (error) { throw new Error(`Failed to list backups: ${error instanceof Error ? error.message : 'Unknown error'}`); } }
- src/mcp/server.ts:295-311 (registration)Tool registration in the TOOLS array, including the tool name 'gepa_list_backups', description, and inputSchema defining parameters limit (default 20) and optional filterLabel.name: 'gepa_list_backups', description: 'List available system backups', inputSchema: { type: 'object', properties: { limit: { type: 'number', default: 20, description: 'Maximum number of backups to return' }, filterLabel: { type: 'string', description: 'Filter backups by label (optional)' } } } },
- src/mcp/server.ts:587-591 (registration)Handler dispatch in the main tool request switch statement, mapping tool calls to the listBackups method with typed arguments.case 'gepa_list_backups': return await this.listBackups(args as { limit?: number; filterLabel?: string; });
- src/mcp/server.ts:297-309 (schema)Input schema/JSON Schema definition for the gepa_list_backups tool parameters.inputSchema: { type: 'object', properties: { limit: { type: 'number', default: 20, description: 'Maximum number of backups to return' }, filterLabel: { type: 'string', description: 'Filter backups by label (optional)' } }