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
| 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:560-605 (handler)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")); - src/mcp/server.ts:553-559 (registration)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, },