Skip to main content
Glama

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
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • 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 } }; }
  • 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: {} } },
  • 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 }); }
  • Dispatch case in the CallToolRequestSchema handler that routes 'trigger_learning' calls to the specific handler function.
    case 'trigger_learning': result = await this.handleTriggerLearning(); break;

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/saralegui-solutions/mcp-self-learning-server'

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