get_collection_cache_health
Monitor cache performance and identify issues with offline browsing capability by checking health status and statistics for the collection cache system.
Instructions
Get health status and statistics for the collection cache system. This helps monitor cache performance and identify any issues with offline browsing capability.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/server/tools/CollectionTools.ts:147-157 (registration)Tool registration including name, description, empty input schema, and handler lambda delegating to server.getCollectionCacheHealth()
{ tool: { name: "get_collection_cache_health", description: "Get health status and statistics for the collection cache system. This helps monitor cache performance and identify any issues with offline browsing capability.", inputSchema: { type: "object", properties: {} } }, handler: () => server.getCollectionCacheHealth() } - The MCP tool handler function, which calls the server's getCollectionCacheHealth method
handler: () => server.getCollectionCacheHealth() - src/server/types.ts:40-40 (schema)TypeScript interface definition for the server method called by the tool handler
getCollectionCacheHealth(): Promise<any>; - src/cache/CollectionCache.ts:193-204 (helper)Core cache statistics computation for collection cache health: item count, age, and validity status
async getCacheStats(): Promise<{ itemCount: number; cacheAge: number; isValid: boolean }> { const cache = await this.loadCache(); if (!cache) { return { itemCount: 0, cacheAge: 0, isValid: false }; } return { itemCount: cache.items.length, cacheAge: Date.now() - cache.timestamp, isValid: Date.now() - cache.timestamp <= this.CACHE_TTL_MS }; } - Aggregated cache health stats from both index and collection caches, likely the data returned by getCollectionCacheHealth()
async getCacheStats(): Promise<any> { const indexStats = this.indexCache.getCacheStats(); const cacheStats = await this.collectionCache.getCacheStats(); return { index: indexStats, collection: cacheStats }; }