Skip to main content
Glama
AdaptiveRetryStrategy.jsโ€ข825 B
import { DefaultRateLimiter, RETRY_MODES } from "@smithy/util-retry"; import { StandardRetryStrategy } from "./StandardRetryStrategy"; export class AdaptiveRetryStrategy extends StandardRetryStrategy { rateLimiter; constructor(maxAttemptsProvider, options) { const { rateLimiter, ...superOptions } = options ?? {}; super(maxAttemptsProvider, superOptions); this.rateLimiter = rateLimiter ?? new DefaultRateLimiter(); this.mode = RETRY_MODES.ADAPTIVE; } async retry(next, args) { return super.retry(next, args, { beforeRequest: async () => { return this.rateLimiter.getSendToken(); }, afterRequest: (response) => { this.rateLimiter.updateClientSendingRate(response); }, }); } }

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/consigcody94/office-whisperer'

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