Skip to main content
Glama
TheAlchemist6

CodeCompass MCP

health_check

Monitor server health, performance, and operational metrics to identify issues and ensure system reliability through real-time insights.

Instructions

🏥 System Health Check - Monitor server health, performance, and operational metrics. Provides comprehensive monitoring dashboard with real-time insights.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
checksNoTypes of health checks to perform
optionsNo

Implementation Reference

  • The primary handler function for the 'health_check' tool. It performs system health checks including monitoring status, API limits via githubService, configuration validation, and optional metrics, insights, and logs.
    async function handleHealthCheck(args: any) {
      try {
        const { checks = ['api-limits', 'system-health', 'monitoring'], options = {} } = args;
        
        // Get comprehensive health status from monitoring system
        const monitoringHealth = monitoring.getHealthStatus();
        const serverMetrics = monitoring.getMetrics();
        
        const health: any = {
          status: monitoringHealth.status,
          timestamp: new Date().toISOString(),
          checks: { ...monitoringHealth.checks },
          metrics: options.include_metrics ? {
            uptime: serverMetrics.uptime,
            memory: serverMetrics.memory,
            version: '1.0.0',
            requestCount: serverMetrics.requestCount,
            errorCount: serverMetrics.errorCount,
            averageResponseTime: serverMetrics.responseTime.average,
            toolUsage: serverMetrics.toolUsage,
          } : undefined,
        };
        
        // Add additional checks based on requested types
        for (const check of checks) {
          switch (check) {
            case 'api-limits':
              try {
                health.checks[check] = await githubService.checkApiLimits();
              } catch (error: any) {
                health.checks[check] = { status: 'error', error: error.message };
              }
              break;
            case 'monitoring':
              health.checks[check] = {
                status: 'healthy',
                totalRequests: serverMetrics.requestCount,
                errorRate: serverMetrics.requestCount > 0 ? Math.round((serverMetrics.errorCount / serverMetrics.requestCount) * 100) : 0,
                uptime: serverMetrics.uptime,
                memoryUsage: Math.round((serverMetrics.memory.heapUsed / serverMetrics.memory.heapTotal) * 100),
              };
              break;
            case 'dependencies':
              health.checks[check] = { status: 'healthy' };
              break;
            case 'configuration':
              health.checks[check] = {
                status: 'healthy',
                hasGitHubToken: !!config.github.token,
                hasOpenRouterKey: !!config.openrouter.apiKey,
                logLevel: config.logging.level,
                maxResponseTokens: config.response.maxTokens,
              };
              break;
          }
        }
        
        // Add performance insights if requested
        if (options.include_insights) {
          const insights = monitoring.getPerformanceInsights();
          health.insights = insights;
        }
        
        // Add recent logs if requested
        if (options.include_logs) {
          const logBuffer = log.getLogBuffer();
          health.recentLogs = logBuffer.slice(-10);
        }
        
        const response = createResponse(health);
        return formatToolResponse(response);
      } catch (error) {
        const response = createResponse(null, error);
        return formatToolResponse(response);
      }
    }
  • The tool definition object including name, description, and inputSchema for the 'health_check' tool, used for registration and validation.
    {
      name: 'health_check',
      description: '🏥 System Health Check - Monitor server health, performance, and operational metrics. Provides comprehensive monitoring dashboard with real-time insights.',
      inputSchema: {
        type: 'object',
        properties: {
          checks: {
            type: 'array',
            items: {
              type: 'string',
              enum: ['api-limits', 'system-health', 'monitoring', 'dependencies', 'configuration'],
            },
            description: 'Types of health checks to perform',
            default: ['api-limits', 'system-health', 'monitoring'],
          },
          options: {
            type: 'object',
            properties: {
              include_metrics: {
                type: 'boolean',
                description: 'Include comprehensive system metrics in response',
                default: false,
              },
              include_insights: {
                type: 'boolean',
                description: 'Include performance insights and recommendations',
                default: false,
              },
              include_logs: {
                type: 'boolean',
                description: 'Include recent log entries',
                default: false,
              },
              include_diagnostics: {
                type: 'boolean',
                description: 'Include diagnostic information',
                default: false,
              },
            },
          },
        },
        required: [],
      },
    },
  • src/index.ts:290-292 (registration)
    The switch case registration in the main CallToolRequestSchema handler that routes 'health_check' calls to the handleHealthCheck function.
    case 'health_check':
      result = await handleHealthCheck(args);
      break;
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 mentions 'real-time insights' and 'comprehensive monitoring dashboard' but doesn't specify whether this is a read-only operation, what permissions might be required, whether it affects system performance, or what the response format looks like. For a monitoring tool with zero annotation coverage, this leaves significant behavioral questions unanswered.

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 appropriately concise with two sentences that efficiently convey the core purpose. The emoji adds visual distinction but doesn't waste space. Every sentence contributes value, though the second sentence could be more specific about what 'dashboard' means in this context.

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?

For a monitoring tool with 2 parameters, nested objects, no annotations, and no output schema, the description is insufficient. It doesn't explain what kind of data is returned, how to interpret results, whether this is a safe operation, or what the monitoring scope includes. The description should provide more context about the tool's behavior and output given the lack of structured metadata.

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?

Schema description coverage is 50% (only the 'checks' parameter has a description in schema). The description adds no specific parameter information beyond what's implied by 'comprehensive monitoring dashboard.' It doesn't explain what the 'checks' array represents or what the 'options' object controls. The description doesn't compensate for the schema coverage gap, but the baseline is 3 since the schema provides some parameter documentation.

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

Purpose4/5

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

The description clearly states the tool's purpose: 'Monitor server health, performance, and operational metrics' with 'Provides comprehensive monitoring dashboard with real-time insights.' It specifies the verb (monitor) and resource (server health/performance/metrics). However, it doesn't explicitly distinguish this health monitoring tool from its siblings which are all code analysis tools, though the domain difference is obvious.

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. It doesn't mention prerequisites, timing considerations, or compare it to any other monitoring or diagnostic tools. The context signals show sibling tools are all code-focused, but the description doesn't help an agent understand when health monitoring is appropriate versus code analysis.

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/TheAlchemist6/codecompass-mcp'

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