WeatherApiSkill

View as MarkdownOpen in Claude

Get current weather conditions for any location using the OpenWeatherMap API.

Provider note: This skill uses OpenWeatherMap (api.openweathermap.org/data/2.5/weather), not WeatherAPI.com. An OpenWeatherMap API key is required — a WeatherAPI.com key will not work. Obtain a key at https://openweathermap.org/api.

Class: WeatherApiSkill

Tools: get_weather (configurable via tool_name)

Env vars: WEATHER_API_KEY

api_key
stringRequired

OpenWeatherMap API key. Falls back to the WEATHER_API_KEY environment variable when the config value is not supplied.

tool_name
stringDefaults to get_weather

Custom name for the generated weather tool.

units
stringDefaults to fahrenheit

Temperature units. Preferred values: "metric" (Celsius), "imperial" (Fahrenheit), or "standard" (Kelvin). Python SDK aliases are also accepted: "celsius""metric", "fahrenheit""imperial".

1import { AgentBase, WeatherApiSkill } from '@signalwire/sdk';
2
3const agent = new AgentBase({ name: 'assistant', route: '/assistant' });
4agent.setPromptText('You are a helpful assistant.');
5
6await agent.addSkill(new WeatherApiSkill({
7 units: 'imperial',
8}));
9
10agent.run();