# Weather Tool Setup The weather tool uses the OpenWeatherMap API to get real-time weather information. ## Setup 1. **Get API Key** (Free tier available): - Visit https://openweathermap.org/api - Sign up for a free account - Get your API key from the dashboard 2. **Set Environment Variable**: ```bash export OPENWEATHERMAP_API_KEY="your-api-key-here" ``` 3. **Or add to `.env` file** (if using python-dotenv): ``` OPENWEATHERMAP_API_KEY=your-api-key-here ``` ## Rate Limits - **Free tier**: 60 requests per hour - The tool automatically enforces rate limiting - Requests are tracked per hour ## Usage The tool accepts: - **Location**: City name (e.g., "San Francisco, CA" or "London, UK") - **Units**: "metric" (Celsius), "imperial" (Fahrenheit), or "kelvin" (default: metric) ## Example ```python # Via MCP { "method": "tools/call", "params": { "name": "weather", "arguments": { "location": "New York, NY", "units": "metric" } } } ``` ## Error Handling The tool handles: - Missing API key (clear error message) - Invalid location (404 error) - Rate limit exceeded (429 error) - Network errors (timeout, connection errors) - Invalid API key (401 error) ## Privacy Note Weather is an exception to the "no external APIs" policy as documented in the privacy policy. This is the only external API used by the system.