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 scope.

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

  • Handler function for the "health_check" tool that analyzes secrets, decay status, and anomalies.
    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"));
  • Registration of the "health_check" tool in the MCP server.
    server.tool(
      "health_check",
      "Run a comprehensive health check on all secrets: decay status, staleness, anomalies, entropy assessment.",
      {
        scope: scopeSchema,
        projectPath: projectPathSchema,
      },

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