quickstart-resources/weather-server-python
Repository files (latest commit first)
Filename Latest commit message Latest commit date
olaservo e83a860df2 Link the dated spec revision, not /draft
The surrounding sentence names 2026-07-28 as the revision that first allows
an array-rooted schema, but the link pointed at /draft, which moves on to
the next revision and stops matching the claim.

Came in with #164. The same fix is on the open Go, Rust, and Ruby branches.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-16 19:49:04 -07:00
..
.python-version First commit 2024-12-11 14:47:06 -05:00
pyproject.toml Add structured content to the Python weather server and client and update to v2 (#164) 2026-08-09 14:46:03 +02:00
README.md Link the dated spec revision, not /draft 2026-08-16 19:49:04 -07:00
uv.lock Add structured content to the Python weather server and client and update to v2 (#164) 2026-08-09 14:46:03 +02:00
weather.py Add structured content to the Python weather server and client and update to v2 (#164) 2026-08-09 14:46:03 +02:00

A Simple MCP Weather Server written in Python

See the Build an MCP server tutorial for more information.

Structured content

Both tools declare an output schema and return structured_content. get_forecast returns an object; get_alerts returns a top-level JSON array, which protocol revision 2026-07-28 is the first to allow — see Structured Content in the spec.

Alerts is a RootModel[list[Alert]] rather than a plain list[Alert] because the SDK wraps non-object return types as {"result": ...}; a RootModel is taken as the schema exactly as written. See Structured Output in the SDK docs.

Note that an array-rooted schema requires a 2026-07-28 client. This SDK does not project it down for older ones — it raises instead.