fix: strip and validate tool outputSchema and inputSchema (#860)

* fix: remove unnecessary fields from tools' outputSchema

* fix: validate input schema root type per MCP spec
This commit is contained in:
Dale Seo 2026-06-02 12:01:33 -04:00 • committed by GitHub
commit 254f04a764
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -169,7 +169,7 @@ async fn main() -> anyhow::Result<()> {
}
```
The generated tool `inputSchema` is derived from the fields of `T`. The type name and documentation on `T` are ignored; only field names, field types, and field documentation are used.
The generated tool `inputSchema` and `outputSchema` are derived from the fields of `T`. The type name and documentation on `T` are ignored; only field names, field types, and field documentation are used.
When you need custom server metadata or multiple capabilities (tools + prompts), use explicit `#[tool_handler]`: