Skip to main content
Glama

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: {} }

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