Skip to main content
Glama

health_check

Run comprehensive health checks on secrets to assess decay status, staleness, anomalies, and entropy for global or project scopes.

Instructions

Run a comprehensive health check on all secrets: decay status, staleness, anomalies, entropy assessment.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
scopeNoScope: global or project
projectPathNoProject root path for project-scoped secrets

Implementation Reference

  • The handler implementation for the 'health_check' MCP tool, which performs secret decay analysis and anomaly detection.
    server.tool(
      "health_check",
      "Run a comprehensive health check on all secrets: decay status, staleness, anomalies, entropy assessment.",
      {
        scope: scopeSchema,
        projectPath: projectPathSchema,
      },
      async (params) => {
        const entries = listSecrets(opts(params));
        const anomalies = detectAnomalies();
    
        let healthy = 0;
        let stale = 0;
        let expired = 0;
        let noDecay = 0;
        const issues: string[] = [];
    
        for (const entry of entries) {
          if (!entry.decay?.timeRemaining) {
            noDecay++;
            continue;
          }
          if (entry.decay.isExpired) {
            expired++;
            issues.push(`EXPIRED: ${entry.key}`);
          } else if (entry.decay.isStale) {
            stale++;
            issues.push(
              `STALE: ${entry.key} (${entry.decay.lifetimePercent}%, ${entry.decay.timeRemaining} left)`,
            );
          } else {
            healthy++;
          }
        }
    
        const summary = [
          `Secrets: ${entries.length} total`,
          `Healthy: ${healthy} | Stale: ${stale} | Expired: ${expired} | No decay: ${noDecay}`,
          `Anomalies: ${anomalies.length}`,
        ];
    
        if (issues.length > 0) {
          summary.push("", "Issues:", ...issues);
        }
        if (anomalies.length > 0) {
          summary.push(
            "",
            "Anomalies:",
            ...anomalies.map((a) => `[${a.type}] ${a.description}`),
          );
        }
    
        return text(summary.join("\n"));
      },

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/I4cTime/quantum_ring'

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