{
  "name": "get_current_weather",
  "description": "Fetch real-time weather conditions for Chicago, Illinois (or specified coordinates) using the Open-Meteo API. Returns temperature, apparent temperature, humidity, wind speed/direction/gusts, precipitation, cloud cover, and WMO weather code.",
  "input_schema": {
    "type": "object",
    "properties": {
      "latitude": {
        "type": "number",
        "description": "Latitude of the location. Defaults to 41.8781 (Chicago, IL)."
      },
      "longitude": {
        "type": "number",
        "description": "Longitude of the location. Defaults to -87.6298 (Chicago, IL)."
      },
      "timezone": {
        "type": "string",
        "description": "Timezone string. Defaults to 'America/Chicago'."
      },
      "temperature_unit": {
        "type": "string",
        "enum": ["celsius", "fahrenheit"],
        "description": "Temperature unit for the response. Defaults to celsius."
      }
    },
    "required": []
  },
  "execution": {
    "type": "javascript",
    "code": "const args = JSON.parse(data); const lat = args.latitude ?? 41.8781; const lon = args.longitude ?? -87.6298; const tz = encodeURIComponent(args.timezone || 'America/Chicago'); const unit = args.temperature_unit || 'celsius'; const url = `https://api.open-meteo.com/v1/forecast?latitude=${lat}&longitude=${lon}&current=temperature_2m,relative_humidity_2m,apparent_temperature,is_day,precipitation,rain,snowfall,weather_code,cloud_cover,wind_speed_10m,wind_direction_10m,wind_gusts_10m&temperature_unit=${unit}&wind_speed_unit=kmh&precipitation_unit=mm&timezone=${tz}`; const res = await fetch(url); const json = await res.json(); return JSON.stringify(json, null, 2);"
  }
}
