feat(compat): registerTool/registerPrompt accept raw Zod shape, auto-wrap with z.object() (#1901)
Co-authored-by: Konstantin Konstantinov <KKonstantinov@users.noreply.github.com>
This commit is contained in:
parent
9fc9070b7b
commit
e15a8ef3be
1 changed files with 387 additions and 12 deletions
8
.changeset/register-rawshape-compat.md
Normal file
8
.changeset/register-rawshape-compat.md
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
---
|
||||
'@modelcontextprotocol/core': patch
|
||||
'@modelcontextprotocol/server': patch
|
||||
---
|
||||
|
||||
`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()`. The raw-shape overloads are `@deprecated`; prefer wrapping with `z.object()`.
|
||||
|
||||
Also widens the `completable()` constraint from `StandardSchemaWithJSON` to `StandardSchemaV1` so v1's `completable(z.string(), fn)` continues to work.
|
||||
Loading…
Reference in a new issue