Skip to main content
Glama

Asset Price MCP Server

cache.ts728 B
interface CacheEntry<T> { data: T; timestamp: number; } export class SimpleCache { private cache: Map<string, CacheEntry<any>> = new Map(); private ttl: number; constructor(ttlMs: number = 60000) { this.ttl = ttlMs; } get<T>(key: string): T | null { const entry = this.cache.get(key); if (!entry) return null; if (Date.now() - entry.timestamp > this.ttl) { this.cache.delete(key); return null; } return entry.data as T; } set<T>(key: string, data: T): void { this.cache.set(key, { data, timestamp: Date.now() }); } clear(): void { this.cache.clear(); } } export const apiCache = new SimpleCache(60000); // Default 1 min cache

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/mk965/asset-price-mcp'

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