Add structured output to the Ruby weather server and client
The mcp gem 1.1.0 (2026-08-01) is the first to negotiate 2026-07-28, so the Ruby examples can finally show the same thing the other four do: get_alerts declares an array-rooted output_schema and returns a bare top-level JSON array, get_forecast returns an object. Declaring `type:` at the root is what suppresses the SDK object-root default. Failure paths return an error result rather than a bare text one, because a tool declaring an output_schema MUST return conforming structured content. No alerts is an empty array, not an error. The client compiles each declared schema at connect time and validates every non-error result. The SDK client does not do this itself, so the spec client-side SHOULD costs real code here, as it does in Go and Rust. NOT READY TO SHIP. The gem never emits the `resultType` field that the 2026-07-28 schema marks mandatory, and no user-level knob sets it, so a spec-strict client rejects every response including tools/list. Verified end-to-end against the Ruby client, which does not check the field; blocked against the TypeScript SDK client. See the server README. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
parent
12ef7bc7d6
commit
d913f3a150
1 changed files with 171 additions and 43 deletions
|
|
@ -2,4 +2,4 @@
|
|||
|
||||
source "https://rubygems.org"
|
||||
|
||||
gem "mcp"
|
||||
gem "mcp", ">= 1.1.0"
|
||||
|
|
|
|||
Loading…
Reference in a new issue