Skip to main content
Glama
saralegui-solutions

MCP Self-Learning Server

get_insights

Analyze interaction patterns to provide learning insights and recommendations for improving autonomous system performance through predictive suggestions.

Instructions

Get learning insights and recommendations

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Core implementation of getInsights in LearningEngine - computes top patterns, tool usage stats, metrics, and recommendations from the self-learning knowledge base.
    getInsights() {
      const topPatterns = Array.from(this.patterns.entries())
        .sort((a, b) => b[1].confidence - a[1].confidence)
        .slice(0, 10);
      
      const topTools = Array.from(this.metrics.toolUsageFrequency.entries())
        .sort((a, b) => b[1] - a[1])
        .slice(0, 5);
      
      return {
        metrics: this.metrics,
        topPatterns: topPatterns.map(([key, pattern]) => ({
          key,
          confidence: pattern.confidence,
          count: pattern.count
        })),
        topTools: topTools.map(([tool, count]) => ({ tool, count })),
        knowledgeItems: this.knowledge.size,
        recommendations: this.generateGlobalRecommendations()
      };
    }
  • MCP tool handler method in SelfLearningMCPServer that invokes the LearningEngine to get insights and adds server metadata.
    async handleGetInsights() {
      const insights = this.learningEngine.getInsights();
      
      return {
        success: true,
        insights,
        uptime: Date.now() - this.startupTime,
        memoryUsage: process.memoryUsage()
      };
    }
  • Registration of the 'get_insights' tool in the MCP server's listTools response, defining name, description, and empty input schema.
      name: 'get_insights',
      description: 'Get learning insights and recommendations',
      inputSchema: {
        type: 'object',
        properties: {}
      }
    },
  • Tool call dispatcher switch case that routes 'get_insights' tool invocations to the handler method.
    result = await this.handleGetInsights();
    break;
  • Input schema for get_insights tool (empty object, no parameters required).
    inputSchema: {
      type: 'object',
      properties: {}
    }
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It only states what the tool does ('Get learning insights and recommendations') without describing what 'insights' means, whether this is a read-only operation, what format results come in, or any limitations like rate limits or authentication requirements.

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 with no wasted words. It's appropriately sized for a zero-parameter tool and gets straight to the point without unnecessary elaboration.

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 of 'insights and recommendations' and the lack of annotations and output schema, the description is insufficient. It doesn't explain what constitutes 'insights', what format they come in, or how they differ from sibling tools' outputs, leaving significant gaps for the agent to understand what this tool actually returns.

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 tool has 0 parameters with 100% schema description coverage, so the schema fully documents the absence of inputs. The description doesn't need to compensate for any parameter gaps, and it appropriately doesn't mention parameters since none exist, earning a baseline score of 4.

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 states the tool's purpose as 'Get learning insights and recommendations', which is a clear verb+object combination. However, it doesn't differentiate from siblings like 'get_performance_metrics' or 'analyze_pattern', leaving ambiguity about what specific type of insights this provides versus alternatives.

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. There's no mention of context, prerequisites, or exclusions, leaving the agent to guess when this is appropriate versus siblings like 'get_performance_metrics' or 'predict_next_action'.

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