Skip to main content
Glama

Github Project Manager

polling.ts802 B
export type BackoffOptions = { readonly initialMs?: number; readonly maxMs?: number; readonly factor?: number; readonly jitterRatio?: number; // 0..1 }; export async function sleep(ms: number): Promise<void> { await new Promise((resolve) => setTimeout(resolve, ms)); } export function nextBackoff(currentMs: number, options?: BackoffOptions): number { const initial = options?.initialMs ?? 1000; const max = options?.maxMs ?? 8000; const factor = options?.factor ?? 2; const jitterRatio = options?.jitterRatio ?? 0.2; const base = Math.max(currentMs || initial, initial) * factor; const withCap = Math.min(base, max); const jitter = withCap * jitterRatio * (Math.random() * 2 - 1); // ±ratio return Math.max(250, Math.round(withCap + jitter)); }

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/Monsoft-Solutions/model-context-protocols'

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