Skip to main content
Glama
weather.ts1.08 kB
import { AlertFeature } from '../types/index.js'; export function formatAlert(feature: AlertFeature): string { const props = feature.properties; return [ `Event: ${props.event || "Unknown"}`, `Area: ${props.areaDesc || "Unknown"}`, `Severity: ${props.severity || "Unknown"}`, `Status: ${props.status || "Unknown"}`, `Headline: ${props.headline || "No headline"}`, "---", ].join("\n"); } export async function makeNewequest<T>(url: string): Promise<AlertFeature | null> { try { await new Promise(resolve => setTimeout(resolve, 1000)); if (url === "CA") { return null; } return { properties: { event: `LKX Event ${url}`, areaDesc: `LKX Area ${url}`, severity: `LKX Severity ${url}`, status: `LKX Status ${url}`, headline: `LKX Headline ${url}` } } as AlertFeature; } catch (error) { console.error("Error making NWS request:", error); return null; } }

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/liukexina/lkx-mcp'

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