Get the FREE Ultimate OpenClaw Setup Guide →

Test Skill

npx machina-cli add skill joeynyc/skillscore/test-skill --openclaw
Files (1)
SKILL.md
1.7 KB

Weather Information Fetcher

Fetches current weather data for any city using OpenWeatherMap API.

Dependencies

  • curl or wget for HTTP requests
  • OpenWeatherMap API key (free registration at openweathermap.org)
  • Environment variable: OPENWEATHER_API_KEY

Installation

  1. Sign up for API key at https://openweathermap.org/api
  2. Set environment variable: export OPENWEATHER_API_KEY=your_api_key
  3. Ensure curl is installed: which curl

Usage

  1. When user asks for weather information for a specific city
  2. Extract the city name from the request
  3. Make API call: curl "http://api.openweathermap.org/data/2.5/weather?q=CITY&appid=$OPENWEATHER_API_KEY&units=metric"
  4. Parse the JSON response and format for user
  5. Handle errors gracefully if city not found or API unavailable

Examples

# Example API call
curl "http://api.openweathermap.org/data/2.5/weather?q=London&appid=your_api_key&units=metric"

Expected response includes temperature, description, humidity, and pressure.

Error Handling

  • No API key: Prompt user to set OPENWEATHER_API_KEY environment variable
  • City not found: Return "City not found, please check spelling"
  • API down: Fallback to generic message "Weather service temporarily unavailable"
  • Network error: Retry once, then inform user of connection issue

Limitations

  • Requires internet connection
  • API has rate limits (1000 calls/day for free tier)
  • Only supports current weather (not forecasts)
  • City names must be in English

Troubleshooting

If you get "unauthorized" error:

  1. Verify API key is correct
  2. Check if key is activated (can take up to 10 minutes)
  3. Ensure environment variable is set properly

Source

git clone https://github.com/joeynyc/skillscore/blob/main/test-skill/SKILL.mdView on GitHub

Overview

Weather Information Fetcher retrieves the current weather for any city by querying the OpenWeatherMap API. It relies on curl or wget, requires an OPENWEATHER_API_KEY environment variable, and handles common errors gracefully. The skill parses the API response to present temperature, weather description, humidity, and pressure.

How This Skill Works

The tool sends an HTTP request to the OpenWeatherMap endpoint using the city name (q=CITY) and the OPENWEATHER_API_KEY, with units=metric. It then parses the JSON response and formats it for user-friendly output, while providing clear messages for missing keys, incorrect city names, or API issues.

When to Use It

  • User requests current weather for a specific city.
  • Planning a trip and need real-time conditions for a destination.
  • Automating weather checks in a script or bot using curl.
  • Requesting weather data in metric units (Celsius).
  • Handling potential errors gracefully (e.g., city not found or API downtime).

Quick Start

  1. Step 1: Sign up for API key at https://openweathermap.org/api and export OPENWEATHER_API_KEY=your_api_key
  2. Step 2: Ensure curl is installed: which curl
  3. Step 3: When asked for weather, make API call: curl "http://api.openweathermap.org/data/2.5/weather?q=CITY&appid=$OPENWEATHER_API_KEY&units=metric"

Best Practices

  • Validate city names are in English.
  • Export and secure the OPENWEATHER_API_KEY environment variable.
  • Use curl or wget to perform the HTTP request.
  • Parse the JSON response and present temperature, description, humidity, and pressure clearly.
  • Implement explicit error handling for missing API key, city not found, API downtime, and network issues.

Example Use Cases

  • curl 'http://api.openweathermap.org/data/2.5/weather?q=London&appid=your_api_key&units=metric'
  • curl 'http://api.openweathermap.org/data/2.5/weather?q=Paris&appid=your_api_key&units=metric'
  • Expected response includes temperature, description, humidity, and pressure from the JSON.
  • If the city is not found, return 'City not found, please check spelling'.
  • If the API key is missing, prompt the user to set OPENWEATHER_API_KEY.

Frequently Asked Questions

Add this skill to your agents
Sponsor this space

Reach thousands of developers