health_check
Check the FedRAMP Docs MCP Server's operational status to verify index readiness, display file counts, repository details, and update settings for compliance analysis.
Instructions
Verify the index is ready and report status. Returns: indexed file count, repository path, FedRAMP docs commit hash and date, last update check time, and auto-update settings.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/search.ts:242-280 (handler)Core handler function that executes the health_check tool logic: retrieves index state, counts indexed files (FRMR + Markdown), fetches repo commit info asynchronously, gets auto-update config, determines if healthy (no errors), and returns structured status.export async function healthCheck(): Promise<{ ok: boolean; indexedFiles: number; repoPath: string; errors?: string[]; repoInfo?: RepoInfo; autoUpdate?: AutoUpdateConfig; }> { const state = getIndexState(); const indexedFiles = state.frmrDocuments.length + state.markdownDocs.size; const errors = getIndexErrors(); // Get repo info (commit hash, date, last fetch time) const repoInfoResult = await getRepoInfo(); const repoInfo: RepoInfo | undefined = repoInfoResult ? { commitHash: repoInfoResult.commitHash, commitDate: repoInfoResult.commitDate, lastFetchedAt: repoInfoResult.lastFetchedAt, } : undefined; // Get auto-update configuration const autoUpdateConfig = getAutoUpdateConfig(); const autoUpdate: AutoUpdateConfig = { enabled: autoUpdateConfig.enabled, checkIntervalHours: autoUpdateConfig.checkIntervalHours, }; return { ok: errors.length === 0, indexedFiles, repoPath: state.repoPath, errors: errors.length ? errors : undefined, repoInfo, autoUpdate, }; }
- src/tools/health_check.ts:8-17 (handler)ToolDefinition for 'health_check': defines name, description, empty input schema, and execute handler that delegates to the core healthCheck function.export const healthCheckTool: ToolDefinition< typeof schema, Awaited<ReturnType<typeof healthCheck>> > = { name: "health_check", description: "Verify the index is ready and report status. Returns: indexed file count, repository path, FedRAMP docs commit hash and date, last update check time, and auto-update settings.", schema, execute: async () => healthCheck(), };
- src/tools/health_check.ts:6-6 (schema)Zod input schema for health_check tool: empty object (no parameters).const schema = z.object({});
- src/types.ts:145-152 (schema)TypeScript interface defining the output structure of the health_check tool result.export interface HealthCheckResult { ok: boolean; indexedFiles: number; repoPath: string; errors?: string[]; repoInfo?: RepoInfo; autoUpdate?: AutoUpdateConfig; }
- src/tools/register.ts:24-53 (registration)Registers the healthCheckTool (along with others) to the MCP server via registerToolDefs.export function registerTools(server: McpServer): void { registerToolDefs(server, [ // Document discovery listFrmrDocumentsTool, getFrmrDocumentTool, listVersionsTool, // KSI tools listKsiTool, getKsiTool, filterByImpactTool, getThemeSummaryTool, getEvidenceExamplesTool, // Control mapping tools listControlsTool, getControlRequirementsTool, analyzeControlCoverageTool, // Search & lookup tools searchMarkdownTool, readMarkdownTool, searchDefinitionsTool, getRequirementByIdTool, // Analysis tools diffFrmrTool, grepControlsTool, significantChangeTool, // System tools healthCheckTool, updateRepositoryTool, ]); }