You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: harden Standard Schema elicitation conversion
- Reject unknown root-level requestedSchema keywords after conversion.
The wire schema's root is a catchall, so keys like the
additionalProperties emitted by z.strictObject() passed the
stripped-keys gate onto the wire; the root is now held to the
spec-declared shape (type/properties/required/$schema, derived from
the wire schema), with annotation-only root keywords dropped.
- Derive redundant format-pattern references from the installed zod at
runtime instead of vendoring its regexes. The vendored literals were
byte-coupled to one zod version against a ^4.2.0 peer range, so any
in-range regex change would reject working schemas at user runtime
while pinned CI stayed green. Customized patterns still reject.
- Throw TypeError (with cause) from inputRequired.elicit on unsupported
schemas, matching the builder's authoring-error convention;
ProtocolError from a prompts/get handler would reach the client as
InvalidParams on its own request.
Copy file name to clipboardExpand all lines: .changeset/standard-schema-elicitation.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,4 +5,4 @@
5
5
---
6
6
7
7
Allow form elicitation requests to accept Standard Schema values such as Zod objects for `requestedSchema`. The server converts these schemas to MCP's restricted elicitation JSON Schema before sending and parses accepted content with the original schema before returning typed
8
-
results. Zod string formats that map to MCP's supported `email`, `uri`, `date`, or `date-time` formats are accepted; arbitrary regex patterns remain rejected because form elicitation does not carry JSON Schema `pattern`.
8
+
results. Zod string formats that map to MCP's supported `email`, `uri`, `date`, or `date-time` formats are accepted; arbitrary regex patterns remain rejected because form elicitation does not carry JSON Schema `pattern`. The converted schema's root is held to the spec's shape (`type`, `properties`, `required`, `$schema`): unknown root keywords — such as the `additionalProperties` emitted by `z.strictObject()` — are rejected before sending, and annotation-only root keywords (`title`, `description`) are dropped.
0 commit comments