get_current_weather
Retrieve real-time weather data for a specified city using this tool. Integrates with Multi-MCPs to fetch accurate weather information quickly and efficiently.
Instructions
Get current weather by city name
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| location | Yes | City name, e.g., London |
Implementation Reference
- src/apis/weather/openweather.ts:85-90 (handler)The handler function for the get_current_weather tool. It validates the API key and location, then delegates to OpenWeatherClient.currentWeatherByCity.async get_current_weather(args: Record<string, unknown>) { if (!cfg.openWeatherApiKey) throw new Error("OPENWEATHER_API_KEY is not configured"); const location = String(args.location || ""); if (!location) throw new Error("location is required"); return client.currentWeatherByCity(location); },
- The tool schema definition for get_current_weather, including name, description, and input schema requiring a 'location' string.{ name: "get_current_weather", description: "Get current weather by city name", inputSchema: { type: "object", properties: { location: { type: "string", description: "City name, e.g., London" }, }, required: ["location"], }, },
- src/tools/register.ts:22-33 (registration)Registration of tool sets in registerAllTools, including the OpenWeather registration which provides the get_current_weather tool.const registrations: ToolRegistration[] = [ registerOpenWeather(), registerGoogleMaps(), registerNewsApi(), registerGitHub(), registerNotion(), registerTrello(), registerSpotify(), registerTwilio(), registerUnsplash(), registerCoinGecko(), ];