Skip to main content
Glama
saralegui-solutions

MCP Self-Learning Server

trigger_learning

Manually initiate a learning cycle to analyze interactions and improve performance through pattern recognition and machine learning techniques.

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 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
        }
      };
    }
  • Tool definition in ListTools response, including schema with no input parameters.
    {
      name: 'trigger_learning',
      description: 'Manually trigger a learning cycle',
      inputSchema: {
        type: 'object',
        properties: {}
      }
    },
  • Registration of the tool handler in the CallToolRequestSchema switch statement.
    case 'trigger_learning':
      result = await this.handleTriggerLearning();
      break;
  • Core learning cycle implementation called by the trigger_learning handler.
    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
      });
    }
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It indicates a manual action ('trigger') but doesn't specify whether this initiates a background process, requires specific permissions, has side effects like data modification, or what the expected outcome or duration is. This leaves significant gaps for a tool that likely involves system changes.

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 function without any fluff or repetition. It's front-loaded and appropriately sized for a simple tool, with every word earning its place.

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

Completeness2/5

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

Given the complexity implied by 'learning cycle' and the lack of annotations and output schema, the description is incomplete. It doesn't explain what happens after triggering, potential impacts, or how it relates to sibling tools, leaving the agent with insufficient context for safe and effective use.

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

Parameters4/5

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

The input schema has 0 parameters with 100% coverage, so no parameter documentation is needed. The description appropriately doesn't add unnecessary param details, aligning with the schema's completeness. Baseline is 4 for zero parameters, as it avoids redundancy.

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

Purpose3/5

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

The description 'Manually trigger a learning cycle' clearly states the action (trigger) and target (learning cycle), but it's somewhat vague about what a 'learning cycle' entails and doesn't differentiate this tool from siblings like 'optimize_tool' or 'analyze_pattern' which might involve related learning processes. It avoids tautology by not just restating the name.

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 like 'optimize_tool' or 'import_knowledge', nor does it mention prerequisites, timing, or context for triggering a learning cycle. It's a standalone statement with implied usage but no explicit instructions.

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

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