Skip to main content
Glama
sloth-wq

Prompt Auto-Optimizer MCP

by sloth-wq

gepa_list_backups

List available system backups for the Prompt Auto-Optimizer MCP server to manage and restore optimized prompt versions.

Instructions

List available system backups

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoMaximum number of backups to return
filterLabelNoFilter backups by label (optional)

Implementation Reference

  • The primary handler function for the 'gepa_list_backups' MCP tool. It destructures parameters, initializes the disaster recovery system, simulates listing backups with filtering and limiting, and returns a formatted text response listing available backups.
      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'}`);
        }
      }
  • Tool registration entry in the MCP server's TOOLS array, defining the tool name, description, and input schema for 'gepa_list_backups'.
      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)'
          }
        }
      }
    },
  • Input schema defining parameters for the gepa_list_backups tool: optional 'limit' (number, default 20) and 'filterLabel' (string).
    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)'
        }
      }
    }
  • Supporting utility method in StateBackupManager that retrieves, filters (by type, date, label, component), sorts (newest first), and returns available backups from the internal registry. Intended for integration with the tool handler.
    getAvailableBackups(filter?: {
      type?: BackupEntry['type'];
      since?: Date;
      label?: string;
      component?: string;
    }): BackupEntry[] {
      let backups = Array.from(this.backupRegistry.values());
      
      if (filter) {
        if (filter.type) {
          backups = backups.filter(b => b.type === filter.type);
        }
        if (filter.since) {
          backups = backups.filter(b => b.timestamp >= filter.since!);
        }
        if (filter.label) {
          backups = backups.filter(b => b.label?.includes(filter.label!));
        }
        if (filter.component) {
          backups = backups.filter(b => 
            b.components.some(c => c.name.includes(filter.component!))
          );
        }
      }
      
      return backups.sort((a, b) => b.timestamp.getTime() - a.timestamp.getTime());
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states it's a list operation, implying read-only behavior, but doesn't cover aspects like rate limits, authentication needs, pagination, or what 'available' means in terms of status or accessibility. For a tool with no annotation coverage, this leaves significant gaps.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that directly states the tool's purpose without any unnecessary words. It's appropriately sized and front-loaded, making it easy for an agent to parse quickly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's low complexity (2 optional parameters, no output schema), the description is minimally complete for a list operation. However, with no annotations and no output schema, it lacks details on behavioral traits and return values, making it adequate but with clear gaps for an agent to rely on.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema description coverage is 100%, with clear descriptions for both parameters ('limit' and 'filterLabel') in the input schema. The description adds no additional parameter semantics beyond what the schema provides, so it meets the baseline score of 3 for adequate coverage without extra value.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'List available system backups' clearly states the verb ('List') and resource ('available system backups'), making the tool's purpose immediately understandable. However, it doesn't differentiate from sibling tools like 'gepa_recovery_status' or 'gepa_restore_backup' which might also relate to backups, so it doesn't reach the highest score.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention sibling tools like 'gepa_recovery_status' or 'gepa_restore_backup', nor does it specify prerequisites or contexts for usage, leaving the agent with minimal direction.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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/sloth-wq/prompt-auto-optimizer-mcp'

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