Skip to main content
Glama
IRateLimiter.ts1.2 kB
/** * Interface defining the contract for rate limiters */ export interface IRateLimiter { /** * Acquires a token for the specified domain, waiting if necessary * @param domain The domain to acquire a token for * @returns A promise that resolves when a token is acquired */ acquireToken(domain: string): Promise<void>; /** * Releases a token back to the specified domain * @param domain The domain to release a token for */ releaseToken(domain: string): void; /** * Sets the rate limit for a specific domain * @param domain The domain to set the rate limit for * @param rateLimit The rate limit in milliseconds between requests */ setRateLimit(domain: string, rateLimit: number): void; /** * Gets the current rate limit for a domain * @param domain The domain to get the rate limit for * @returns The rate limit in milliseconds, or null if not set */ getRateLimit(domain: string): number | null; /** * Resets all rate limiting information */ reset(): void; /** * Gets statistics about the current rate limits * @returns An object containing statistics about the rate limiter */ getStats(): Record<string, any>; }

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/visheshd/docmcp'

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