trigger_learning
Manually initiate a learning cycle to analyze patterns, improve machine learning models, and enhance predictive capabilities within the MCP Self-Learning Server.
Instructions
Manually trigger a learning cycle
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- mcp-self-learning-server.js:1183-1195 (handler)The handler function for the 'trigger_learning' MCP tool. It manually triggers a learning cycle on the LearningEngine and returns completion stats.async handleTriggerLearning() { await this.learningEngine.performLearningCycle(); return { success: true, message: 'Learning cycle completed', stats: { patterns: this.learningEngine.patterns.size, knowledge: this.learningEngine.knowledge.size, cycles: this.learningEngine.metrics.learningCycles } }; }
- mcp-self-learning-server.js:983-990 (registration)Registration of the 'trigger_learning' tool in the list of available tools, including its name, description, and empty input schema.{ name: 'trigger_learning', description: 'Manually trigger a learning cycle', inputSchema: { type: 'object', properties: {} } },
- mcp-self-learning-server.js:269-290 (helper)Core helper function performLearningCycle() called by the trigger_learning handler. Performs consolidation, updates, optimization, and pruning of learned patterns.async performLearningCycle() { logger.info('Performing learning cycle', { cycle: this.metrics.learningCycles + 1 }); this.metrics.learningCycles++; // Consolidate patterns await this.consolidatePatterns(); // Update knowledge base await this.updateKnowledgeBase(); // Optimize performance await this.optimizePerformance(); // Prune outdated patterns await this.pruneOutdatedPatterns(); this.emit('learning-complete', { cycle: this.metrics.learningCycles, patternsLearned: this.patterns.size, knowledgeItems: this.knowledge.size }); }
- mcp-self-learning-server.js:1078-1080 (registration)Dispatch case in the CallToolRequestSchema handler that routes 'trigger_learning' calls to the specific handler function.case 'trigger_learning': result = await this.handleTriggerLearning(); break;