Skip to main content
Glama
telegram-notifier.ts1.19 kB
interface TelegramApiResponse { ok: boolean; result?: unknown; error_code?: number; description?: string; } let telegramUrl: string | undefined; function configureTelegram(url?: string): void { telegramUrl = url; } async function notifyTelegram(message: string): Promise<void> { if (!telegramUrl) return; try { const prefixedMessage = `[MCP] ${message}`; const response = await fetch(telegramUrl, { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ text: prefixedMessage }), signal: AbortSignal.timeout(5000), }); if (!response.ok) { const errorText = await response.text(); console.error(`[Telegram] HTTP ${response.status}: ${errorText}`); return; } const result = (await response.json()) as TelegramApiResponse; if (!result.ok) { console.error(`[Telegram] API error:`, result); return; } console.log(`[Telegram] Message sent successfully`); } catch (error) { console.error( `[Telegram] Send failed:`, error instanceof Error ? error.message : String(error) ); } } export { configureTelegram, notifyTelegram };

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/adimowis/appler'

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