Skip to main content
Glama

get_collection_cache_health

Monitor the health and performance of the collection cache system to ensure offline browsing functionality and identify potential issues. Supports effective cache management.

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

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Registration of the get_collection_cache_health tool including name, description, empty input schema, and handler function that delegates to the server's getCollectionCacheHealth method.
    { 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() }
  • Interface definition for IToolHandler declaring the getCollectionCacheHealth method signature.
    getCollectionCacheHealth(): Promise<any>;
  • CollectionCache.getCacheStats() provides basic health statistics (itemCount, cacheAge, isValid) likely used by the tool's underlying server method.
    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 }; }
  • CollectionIndexCache.getCacheStats() provides comprehensive cache health metrics including validity, age, element count, memory cache stats, and performance metrics.
    getCacheStats(): { isValid: boolean; age: number; hasCache: boolean; elements: number; memoryCache: any; performanceMetrics: any; } { if (!this.cache) { return { isValid: false, age: 0, hasCache: false, elements: 0, memoryCache: this.memoryCache.getStats(), performanceMetrics: null }; } const age = Date.now() - this.cache.fetchedAt.getTime(); return { isValid: this.isValid(), age, hasCache: true, elements: this.cache.data.total_elements, memoryCache: this.memoryCache.getStats(), performanceMetrics: { cacheHitRate: this.calculateCacheHitRate(), averageAccessTime: this.calculateAverageAccessTime() } }; }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/DollhouseMCP/DollhouseMCP'

If you have feedback or need assistance with the MCP directory API, please join our Discord server