fix: convert elicitation Standard Schemas via an explicit wire-grammar walk (#2454)

This commit is contained in:
Felix Weinberger 2026-07-09 12:30:57 +01:00 • committed by GitHub
commit 3834921074
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -3,4 +3,4 @@
'@modelcontextprotocol/server': minor
---
Allow `inputRequired.elicit()` to accept a Standard Schema such as a Zod object for `requestedSchema`. The builder converts it to MCP's restricted form-elicitation JSON Schema, while the same schema can validate and type the response through `acceptedContent()` on handler re-entry.
Allow `inputRequired.elicit()` to accept a Standard Schema such as a Zod object for `requestedSchema`. The builder converts it to MCP's restricted form-elicitation JSON Schema, while the same schema can validate and type the response through `acceptedContent()` on handler re-entry. Zod formats mapping to `email`, `uri`, `date`, and `date-time` are supported. Shapes the restricted schema cannot express reject before anything is sent — nested objects, `.regex()` and customized zod format patterns, exclusive number bounds (`.positive()`/`.gt()`), literal unions (use `z.enum` or `z.literal(['a', 'b'])`), and non-spec root keywords like `z.strictObject()`'s `additionalProperties`.