航空天气
按 ICAO 机场代码查询最近的 METAR 实况报文,可选附带 TAF 机场预报。数据来自美国 NOAA 航空天气中心,不可用于飞行计划或导航。
| 接口 | POST /v1/aviation-weather-queries |
| 所需权限 | aviation_weather:query |
| MCP 工具 | aviation_weather |
| 计量单位 | reports |
计量单位出现在 execution.usage.units 中,用于对账和计费。
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
invocation_id |
string | 是 | 调用方(市场)生成的调用 ID:同一个 ID 在同一操作上只执行一次,用同一 ID 重试会被拒绝而不会重复计费。1–128 个字符,可用 A-Z a-z 0-9 . _ : -。 |
provider |
string | 是 | 处理本次请求的数据源,按下方数据源表的覆盖范围选择。 可选值:awc |
stations |
string[] | 是 | 1–10 个四字母 ICAO 机场代码,例如 KJFK、EGLL。 |
hours_before |
integer | 否 | 返回过去多少小时的 METAR 实况,1–24,默认 2。 |
include_taf |
boolean | 否 | 是否同时返回各机场的 TAF 机场预报,默认 false。 |
| 数据源 | 区域 | 说明 | 限制 |
|---|---|---|---|
awc |
US | 美国 NOAA 航空天气中心 | max_hours_before: 24, max_stations: 10, timeout_seconds: 30 |
curl -sS https://services.zgi.im/v1/aviation-weather-queries \ -H "Authorization: Bearer $ZGI_SERVICES_TOKEN" \ -H 'Content-Type: application/json' \ -d '{"invocation_id": "docs-1791778521-aviation_weather", "provider": "awc", "stations": ["KJFK", "EGLL"], "hours_before": 2, "include_taf": true}'POST /v1/aviation-weather-queries HTTP/1.1Host: services.zgi.imAuthorization: Bearer <token>Content-Type: application/json
{ "invocation_id": "docs-1791778521-aviation_weather", "provider": "awc", "stations": [ "KJFK", "EGLL" ], "hours_before": 2, "include_taf": true}通过 MCP 调用时,工具参数与 HTTP 请求体完全相同。
{ "jsonrpc": "2.0", "id": 1, "method": "tools/call", "params": { "name": "aviation_weather", "arguments": { "invocation_id": "docs-1791778521-aviation_weather", "provider": "awc", "stations": [ "KJFK", "EGLL" ], "hours_before": 2, "include_taf": true } }}curl -sS https://services.zgi.im/v1/mcp \ -H "Authorization: Bearer $ZGI_SERVICES_TOKEN" \ -H 'Content-Type: application/json' -H 'Accept: application/json, text/event-stream' \ -H 'MCP-Protocol-Version: 2025-11-25' \ -d @request.json以下为一次真实调用的返回,列表只保留前两项,长文本已截断。
{ "code": 0, "message": "success", "data": { "execution": { "id": "exe_01a12e5285747d5aaa58a5d45c196d46", "invocation_id": "docs-1791778521-aviation_weather", "capability": "aviation_weather", "operation": "aviation_weather.query", "provider": "awc", "outcome": "succeeded", "error_category": null, "error_code": null, "usage": { "provider_requests": 2, "units": [ { "name": "reports", "value": 8, "source": "measured" } ] }, "upstream_ref": null, "request_id": "req_8cfeac9ad47ed9f59793d8b6", "started_at": "2026-10-12T04:15:22.484860171Z", "finished_at": "2026-10-12T04:15:22.884014296Z", "duration_ms": 399 }, "result": { "stations": [ { "icao": "KJFK", "name": "New York/JF Kennedy Intl, NY, US", "latitude": 40.6392, "longitude": -73.7639, "metars": [ { "raw": "METAR KJFK 120351Z 01013KT 8SM -RA BKN007 OVC020 13/12 A2982 RMK AO2 PRESFR SLP098 P0009 T01280122 $", "observed_at": "2026-10-12T03:51:00Z", "temperature_c": 12.8, "dewpoint_c": 12.2, "wind_direction_deg": 10, "wind_variable": false, "wind_speed_kt": 13, "wind_gust_kt": null, "visibility": "8", "altimeter_hpa": 1009.9, "flight_category": "IFR" }, { "raw": "METAR KJFK 120251Z 02014KT 8SM -RA BKN007 OVC025 14/13 A2984 RMK AO2 RAB51 SLP104 P0000 60013 T01390128 55022 $", "observed_at": "2026-10-12T02:51:00Z", "temperature_c": 13.9, "dewpoint_c": 12.8, "wind_direction_deg": 20, "wind_variable": false, "wind_speed_kt": 14, "wind_gust_kt": null, "visibility": "8", "altimeter_hpa": 1010.6, "flight_category": "IFR" } ], "taf": { "raw": "TAF KJFK 120250Z 1203/1306 02012KT 6SM -SHRA BR SCT004 OVC008 FM120330 02012KT 6SM BR VCTS SCT004 OVC008CB FM120430 02012KT P6SM VCSH OVC008 FM121200 01012KT...", "issued_at": "2026-10-12T02:50:00Z", "valid_from": "2026-10-12T03:00:00Z", "valid_to": "2026-10-13T06:00:00Z" } }, { "icao": "EGLL", "name": "London/Heathrow Intl, EN, GB", "latitude": 51.477, "longitude": -0.461, "metars": [ { "raw": "METAR EGLL 120350Z AUTO 11009KT 9999 NCD 10/10 Q1013", "observed_at": "2026-10-12T03:50:00Z", "temperature_c": 10, "dewpoint_c": 10, "wind_direction_deg": 110, "wind_variable": false, "wind_speed_kt": 9, "wind_gust_kt": null, "visibility": "6+", "altimeter_hpa": 1013, "flight_category": "VFR" }, { "raw": "METAR EGLL 120320Z AUTO 12008KT 9999 NCD 10/10 Q1013", "observed_at": "2026-10-12T03:20:00Z", "temperature_c": 10, "dewpoint_c": 10, "wind_direction_deg": 120, "wind_variable": false, "wind_speed_kt": 8, "wind_gust_kt": null, "visibility": "6+", "altimeter_hpa": 1013, "flight_category": "VFR" } ], "taf": { "raw": "TAF EGLL 112252Z 1200/1306 14008KT 9999 BKN025 PROB30 TEMPO 1202/1207 8000 -RA PROB40 TEMPO 1207/1209 7000 -RADZ BKN014 BECMG 1209/1212 BKN012 TEMPO 1209/122...", "issued_at": "2026-10-11T22:52:00Z", "valid_from": "2026-10-12T00:00:00Z", "valid_to": "2026-10-13T06:00:00Z" } } ], "unknown_stations": [], "disclaimer": "Not for flight planning or navigation.", "source": { "name": "NOAA Aviation Weather Center", "license": "US public domain", "url": "https://aviationweather.gov" } } }}