Skip to main content
Glama

gepa_integrity_check

Verify and repair data integrity for the Prompt Auto-Optimizer MCP's evolutionary algorithm components, including evolution states, trajectories, and configuration data.

Instructions

Perform comprehensive data integrity check

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
componentNoComponent to check integrity forall
autoRepairNoAttempt automatic repair of detected issues

Implementation Reference

  • The MCP tool handler for 'gepa_integrity_check'. Initializes disaster recovery, calls performIntegrityCheck on it, filters results by component, and returns formatted text response with status, summary, and recommendations.
    private async performIntegrityCheck(params: { component?: string; autoRepair?: boolean; }): Promise<{ content: { type: string; text: string; }[] }> { const { component = 'all', autoRepair = false } = params; try { await this.disasterRecovery.initialize(); const results = await this.disasterRecovery.performIntegrityCheck() as unknown as IntegrityCheckResult[]; const filteredResults = component === 'all' ? results : results.filter(r => r.component === component); const overallValid = filteredResults.every(r => r.valid); const corruptionCount = filteredResults.filter(r => !r.valid).length; return { content: [ { type: 'text', text: `# Data Integrity Check Results ## Overall Status: ${overallValid ? '✅ PASSED' : '❌ ISSUES DETECTED'} ### Summary - **Components Checked**: ${filteredResults.length} - **Valid Components**: ${filteredResults.filter(r => r.valid).length} - **Corrupted Components**: ${corruptionCount} - **Auto-Repair**: ${autoRepair ? 'Enabled' : 'Disabled'} ### Detailed Results ${filteredResults.map(result => `#### ${result.component} - **Overall Valid**: ${result.valid ? '✅ Yes' : '❌ No'} - **Checksum Valid**: ${result.checksumValid ? '✅' : '❌'} - **Size Match**: ${result.sizeMatch ? '✅' : '❌'} - **Dependencies Valid**: ${result.dependenciesValid ? '✅' : '❌'} ${result.errors.length > 0 ? `- **Errors**: ${result.errors.join(', ')}` : ''} `).join('\n')} ${corruptionCount > 0 ? `### Recommendations ${filteredResults.filter(r => !r.valid).map(result => `- **${result.component}**: Consider ${autoRepair ? 'manual review of auto-repair results' : 'running with autoRepair enabled or manual restoration'}` ).join('\n')}` : ''} ${overallValid ? 'All checked components passed integrity validation.' : `${corruptionCount} component(s) failed integrity checks. ${autoRepair ? 'Auto-repair was attempted.' : 'Consider running with autoRepair enabled.'}`}`, }, ], }; } catch (error) { throw new Error(`Failed to perform integrity check: ${error instanceof Error ? error.message : 'Unknown error'}`); } }
  • Tool registration in the TOOLS array, including name, description, and input schema definition.
    { name: 'gepa_integrity_check', description: 'Perform comprehensive data integrity check', inputSchema: { type: 'object', properties: { component: { type: 'string', enum: ['all', 'evolution_state', 'trajectories', 'configuration', 'cache'], default: 'all', description: 'Component to check integrity for' }, autoRepair: { type: 'boolean', default: false, description: 'Attempt automatic repair of detected issues' } } } }
  • Dispatch handler in the switch statement that routes tool calls to the performIntegrityCheck method.
    case 'gepa_integrity_check': return await this.performIntegrityCheck(args as { component?: string; autoRepair?: boolean; });
  • TypeScript interface defining the structure of integrity check results used in the tool response.
    export interface IntegrityCheckResult { component: string; valid: boolean; checksumValid?: boolean; sizeMatch?: boolean; dependenciesValid?: boolean; errors: string[]; }
  • Core helper function in DataIntegrityManager that orchestrates comprehensive integrity checks across evolution state, trajectories, configuration, cache, and cross-references, processing results and triggering repairs.
    async performComprehensiveCheck(): Promise<IntegrityCheckResult[]> { return this.resilience.executeWithFullProtection( async () => { const results: IntegrityCheckResult[] = []; // Check evolution state integrity const evolutionResult = await this.checkEvolutionStateIntegrity(); if (evolutionResult) results.push(evolutionResult); // Check trajectory data integrity const trajectoryResults = await this.checkTrajectoryDataIntegrity(); results.push(...trajectoryResults); // Check configuration integrity const configResult = await this.checkConfigurationIntegrity(); if (configResult) results.push(configResult); // Check cache integrity const cacheResults = await this.checkCacheIntegrity(); results.push(...cacheResults); // Check cross-references if enabled if (this.config.crossReferenceChecks) { const crossRefResults = await this.checkCrossReferences(); results.push(...crossRefResults); } // Process results and trigger repairs if needed await this.processIntegrityResults(results); this.emit('comprehensiveCheckCompleted', { resultCount: results.length, corruptionDetected: results.some(r => !r.overallValid) }); return results; }, { serviceName: 'data-integrity', context: { name: 'comprehensive-check', priority: 'high' } } ); }

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