Skip to main content
Glama
saralegui-solutions

MCP Self-Learning Server

get_performance_metrics

Retrieve detailed performance metrics from the self-learning server to analyze tool usage patterns and track system improvements over time.

Instructions

Get detailed performance metrics

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
timeRangeNoall

Implementation Reference

  • The core handler function that implements the get_performance_metrics tool. It extracts metrics from the learning engine, applies time range filtering (placeholder), computes detailed tool usage and error breakdowns, and includes recommendations.
    async handleGetPerformanceMetrics(args) {
      const { timeRange = 'all' } = args;
      const metrics = { ...this.learningEngine.metrics };
      
      // Filter by time range if needed
      if (timeRange !== 'all') {
        // In production, would filter based on actual timestamps
        metrics.timeRange = timeRange;
      }
      
      // Add detailed breakdowns
      metrics.toolBreakdown = Array.from(metrics.toolUsageFrequency.entries())
        .map(([tool, count]) => ({ tool, count, percentage: (count / metrics.totalInteractions * 100).toFixed(2) }));
      
      metrics.errorBreakdown = Array.from(metrics.errorPatterns.entries())
        .map(([error, count]) => ({ error, count }));
      
      return {
        success: true,
        metrics,
        recommendations: this.learningEngine.generateGlobalRecommendations()
      };
    }
  • Input schema defining the parameters for the tool, specifically an optional 'timeRange' with allowed values.
    inputSchema: {
      type: 'object',
      properties: {
        timeRange: {
          type: 'string',
          enum: ['hour', 'day', 'week', 'all'],
          default: 'all'
        }
      }
    }
  • Tool registration in the MCP server's tools array, specifying name, description, and input schema for MCP discovery.
    {
      name: 'get_performance_metrics',
      description: 'Get detailed performance metrics',
      inputSchema: {
        type: 'object',
        properties: {
          timeRange: {
            type: 'string',
            enum: ['hour', 'day', 'week', 'all'],
            default: 'all'
          }
        }
      }
    }
  • Dispatch case in the MCP tool request handler that routes calls to get_performance_metrics to its handler function.
    case 'get_performance_metrics':
      result = await this.handleGetPerformanceMetrics(args);
      break;
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 states 'Get' implies a read operation, but doesn't specify if it's safe, requires authentication, has rate limits, or what the return format looks like. This is a significant gap for a tool with zero annotation coverage.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence with no wasted words, making it appropriately concise. However, it's front-loaded but lacks depth, which slightly reduces its effectiveness despite the brevity.

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 no annotations, no output schema, and low schema description coverage, the description is incomplete. It doesn't explain what 'detailed performance metrics' entail, how they're returned, or behavioral aspects, leaving the agent with insufficient context for a tool that likely returns complex data.

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

Parameters3/5

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

The input schema has 1 parameter with 0% description coverage, but the description doesn't mention the 'timeRange' parameter or its semantics. Since schema coverage is low, the description should compensate but doesn't. However, with only 1 parameter and an enum providing some clarity, a baseline 3 is appropriate as the schema does minimal heavy lifting.

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 'Get detailed performance metrics' states a clear verb ('Get') and resource ('performance metrics'), but it's vague about what specific metrics are retrieved and doesn't differentiate from sibling tools like 'get_insights' or 'analyze_pattern'. It provides a basic purpose but lacks specificity.

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 offers no guidance on when to use this tool versus alternatives such as 'get_insights' or 'analyze_pattern'. There's no mention of context, prerequisites, or exclusions, leaving the agent with no usage direction beyond the tool name.

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