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
| Name | Required | Description | Default |
|---|---|---|---|
| scope | No | Scope: global or project | |
| projectPath | No | Project root path for project-scoped secrets |
Implementation Reference
- src/mcp/server.ts:821-874 (handler)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")); },