status
Check server health, session state, and cache statistics to debug data freshness and connectivity issues in Disney Parks information.
Instructions
Get server health status, session state, and cache statistics. Useful for debugging data freshness and connectivity issues.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| includeDetails | No | Include detailed cache and entity breakdown (default: false) |
Implementation Reference
- src/tools/status.ts:30-120 (handler)The handler function that implements the core logic of the 'status' tool, collecting server uptime, session statuses, cache statistics, database stats, embedding stats, and health checks, optionally including detailed entity counts.export const handler: ToolHandler = async (args) => { return withTimeout( "status", async () => { const includeDetails = args.includeDetails === true; const sessionManager = getSessionManager(); const dbStats = await getDatabaseStats(); const cacheStats = await getCacheStats(); const embeddingStats = await getEmbeddingStats(); // Get session status for each destination const wdwSession = await sessionManager.getSessionStatus("wdw"); const dlrSession = await sessionManager.getSessionStatus("dlr"); const status = { server: { version: "1.0.0", uptime: Math.round(process.uptime()), timestamp: new Date().toISOString(), }, sessions: { wdw: { hasSession: wdwSession.hasSession, isValid: wdwSession.isValid, expiresAt: wdwSession.expiresAt, errorCount: wdwSession.errorCount, }, dlr: { hasSession: dlrSession.hasSession, isValid: dlrSession.isValid, expiresAt: dlrSession.expiresAt, errorCount: dlrSession.errorCount, }, }, cache: { totalEntries: cacheStats.totalEntries, expiredEntries: cacheStats.expiredEntries, sources: cacheStats.sources, }, database: { entityCount: dbStats.entityCount, cacheEntries: dbStats.cacheEntries, sizeKb: Math.round(dbStats.dbSizeBytes / 1024), }, embeddings: { total: embeddingStats.total, ready: embeddingStats.total >= dbStats.entityCount, byModel: embeddingStats.byModel, }, health: { databaseHealthy: dbStats.entityCount >= 0, cacheHealthy: cacheStats.expiredEntries < cacheStats.totalEntries, wdwSessionHealthy: wdwSession.isValid || !wdwSession.hasSession, dlrSessionHealthy: dlrSession.isValid || !dlrSession.hasSession, }, }; // Add detailed breakdown if requested if (includeDetails) { const wdwCounts = await getEntityCounts("wdw"); const dlrCounts = await getEntityCounts("dlr"); Object.assign(status, { details: { wdw: { attractions: wdwCounts.ATTRACTION, restaurants: wdwCounts.RESTAURANT, shows: wdwCounts.SHOW, }, dlr: { attractions: dlrCounts.ATTRACTION, restaurants: dlrCounts.RESTAURANT, shows: dlrCounts.SHOW, }, }, }); } return { content: [ { type: "text" as const, text: JSON.stringify(status, null, 2), }, ], }; }, TIMEOUTS.STATUS ); };
- src/tools/status.ts:13-28 (schema)The tool definition including name, description, and input schema for optional detailed output.export const definition: ToolDefinition = { name: "status", description: "Get server health status, session state, and cache statistics. " + "Useful for debugging data freshness and connectivity issues.", inputSchema: { type: "object" as const, properties: { includeDetails: { type: "boolean", description: "Include detailed cache and entity breakdown (default: false)", }, }, required: [], }, };
- src/tools/index.ts:20-28 (registration)The 'status' tool is registered in the central tools array alongside other tools, imported from './status.js' on line 14.const tools: ToolEntry[] = [ { definition: destinations.definition, handler: destinations.handler }, { definition: attractions.definition, handler: attractions.handler }, { definition: dining.definition, handler: dining.handler }, { definition: search.definition, handler: search.handler }, { definition: discover.definition, handler: discover.handler }, { definition: status.definition, handler: status.handler }, { definition: sync.definition, handler: sync.handler }, ];