SKILL.md
readonly只读
name
weather
description
使用 web_fetch 获取当前天气和预报,回退到 wttr.in curl 查询位置、降雨、温度、旅行规划。
天气
用于当前天气、降雨/温度检查、预报和旅行规划。需要城市、地区、机场代码或坐标。
首选:web_fetch
当工具可用时,优先使用 web_fetch。请求 JSON 格式,因为 wttr.in 在使用浏览器类 User-Agent 调用时,许多文本格式会返回面向浏览器的 HTML。
await web_fetch({
url: "https://wttr.in/London?format=j2",
extractMode: "text",
maxChars: 12000,
});
对于简短回答,总结 current_condition[0]、nearest_area[0] 和 weather[] 中的前几条记录。使用 format=j2 进行常规总结,因为它省略了冗长的逐小时数据,并且适合默认的 web_fetch 输出上限。有用的 JSON 字段:
current_condition[0].weatherDesc[0].value:天气状况current_condition[0].temp_C/temp_F:温度current_condition[0].FeelsLikeC/FeelsLikeF:体感温度current_condition[0].precipMM:降水量current_condition[0].humidity:湿度current_condition[0].windspeedKmph/windspeedMiles:风速weather[].date、maxtempC、mintempC:预报
回退方案:curl
仅在 web_fetch 不可用或被禁用时使用 curl。优先使用 HTTPS 并引用 URL。
curl --fail --silent --show-error --max-time 20 "https://wttr.in/London?format=j1"
curl --fail --silent --show-error --max-time 20 "https://wttr.in/London?format=3"
curl --fail --silent --show-error --max-time 20 "https://wttr.in/London?0"
curl --fail --silent --show-error --max-time 20 "https://wttr.in/London?format=v2"
curl --fail --silent --show-error --max-time 20 "https://wttr.in/New+York?format=3"
有用的格式:
%l:位置%c:天气图标%t:温度%f:体感温度%w:风速%h:湿度%p:降水量
curl --fail --silent --show-error --max-time 20 "https://wttr.in/London?format=%l:+%c+%t,+feels+%f,+rain+%p,+wind+%w"






