Skip to main content
Glama
pshempel

MCP Time Server Node

by pshempel
timeCache.ts875 B
import { hashCacheKey } from './cacheKeyHash'; import { MemoryAwareCache } from './memoryAwareCache'; import type { MemoryStats } from './memoryAwareCache'; // Cache TTL by operation type (in seconds) export const CacheTTL = { CURRENT_TIME: 1, // 1 second TIMEZONE_CONVERT: 300, // 5 minutes CALCULATIONS: 3600, // 1 hour BUSINESS_DAYS: 86400, // 24 hours }; // Create cache instance with 10MB memory limit export const cache = new MemoryAwareCache({ maxMemory: 10 * 1024 * 1024, // 10MB limit stdTTL: 60, // Default 60 seconds checkperiod: 120, // Check for expired keys every 2 minutes evictOnFull: true, // Enable eviction when memory limit reached }); // Export memory stats for monitoring export function getCacheMemoryStats(): MemoryStats { return cache.getMemoryStats(); } // Re-export the hash function for use in tools export { hashCacheKey };

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/pshempel/mcp-time-server-node'

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