UNPKG

opsgenie-mcp-server

Version:

A Model Context Protocol (MCP) server that provides comprehensive Opsgenie alert management capabilities

22 lines (21 loc) 868 B
import { z } from "zod"; import { getWeatherAlerts, getWeatherForecast } from "../weather/api.js"; export function registerWeatherTools(server) { // Register weather alerts tool server.tool("get_alerts", "Get weather alerts for a state", { state: z.string().length(2).describe("Two-letter state code (e.g. CA, NY)"), }, async ({ state }) => { return await getWeatherAlerts(state); }); // Register weather forecast tool server.tool("get_forecast", "Get weather forecast for a location", { latitude: z.number().min(-90).max(90).describe("Latitude of the location"), longitude: z .number() .min(-180) .max(180) .describe("Longitude of the location"), }, async ({ latitude, longitude }) => { return await getWeatherForecast(latitude, longitude); }); }