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): accept raw Zod shape in registerTool/registerPrompt schemas
v1 allowed passing a raw shape like `{ field: z.string() }` directly as
inputSchema/outputSchema/argsSchema. v2 expects a Standard Schema (e.g.
`z.object({...})`). This restores the v1 shorthand as a deprecated overload:
- core: add isZodRawShape() guard + normalizeRawShapeSchema() that auto-wraps
raw shapes in z.object() and emits a one-time deprecation warning via
deprecate('raw-shape', ...).
- server: convert registerTool/registerPrompt to overload sets with a
@deprecated ZodRawShape-accepting signature so v1 callers typecheck
unchanged. Implementation pipes schemas through normalizeRawShapeSchema.
- server: add ZodRawShape / LegacyToolCallback / LegacyPromptCallback
deprecated type aliases for the legacy callback inference.
The shim warns once per process and will be removed in v3.
`registerTool`/`registerPrompt` accept a raw Zod shape (`{ field: z.string() }`) for `inputSchema`/`outputSchema`/`argsSchema` in addition to a wrapped Standard Schema. Raw shapes are auto-wrapped with `z.object()`. Both forms are first-class.
0 commit comments