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
feat(compat): mark setRequestHandler/setNotificationHandler Zod-schema overloads @deprecated; address review
- @deprecated on the Zod-schema overloads of setRequestHandler /
setNotificationHandler (Protocol + Client + Server). The 3-arg
(method, paramsSchema, handler) form is the non-deprecated path
for custom methods. request()/mcpReq.send()/callTool schema
overloads are NOT deprecated (only typed form for custom-method
results).
- Unify positional-schema detection via isResultSchemaLike()
(~standard or .parse) used by request(), mcpReq.send() and
callTool().
- request()/mcpReq.send() now reject with a clear TypeError when a
non-spec method is called without a result schema (was: undefined
schema crashed in parseSchema downstream).
- Avoid redundant spec-schema parses: _setRequestHandlerByMethod()
takes skipSpecParse; Server/Client overrides pass true for their
per-method wrappers and for the Zod-schema form. Aligns Protocol
with subclasses (both skip when user supplied a schema).
- compatSchema.ts: drop @internal from file header (ZodLikeRequestSchema
is publicly exported); add isResultSchemaLike helper.
- Tests: client setRequestHandlerSchemaParity (elicitation+sampling),
compatSchema helpers, runtime-guard cases for request()/mcpReq.send().
/** For spec methods the method-string form is more concise; this overload is the supported call form for non-spec methods or when you want full-envelope validation. */
347
+
/** @deprecated Use the 3-arg `(method, paramsSchema, handler)` form for custom methods, or the method-string form for spec methods. */
/** For spec methods the method-string form is more concise; this overload is the supported call form for non-spec methods or when you want full-envelope validation. */
1056
+
/** @deprecated Use the 3-arg `(method, paramsSchema, handler)` form for custom methods, or the method-string form for spec methods. */
/** For spec methods the method-string form is more concise; this overload is the supported call form for non-spec methods or when you want full-envelope validation. */
1132
+
/** @deprecated Use the 3-arg `(method, paramsSchema, handler)` form for custom methods, or the method-string form for spec methods. */
0 commit comments