docs: registerTool accepts strict zod object
This commit is contained in:
@@ -53,7 +53,10 @@ Applies to every change in this repo, by any agent or human.
|
||||
- stdout is the MCP protocol channel — diagnostics go to `console.error` ONLY,
|
||||
never `console.log`
|
||||
- ESM with NodeNext resolution: relative imports need the `.js` extension
|
||||
- MCP SDK v1 (`@modelcontextprotocol/sdk`): `registerTool` takes a ZodRawShape
|
||||
(plain object of zod fields), NOT `z.object()`; subpath imports
|
||||
(`server/mcp.js`, `server/stdio.js`, `client/index.js`, `inMemory.js`, `types.js`)
|
||||
- MCP SDK v1 (`@modelcontextprotocol/sdk`): `registerTool` accepts a ZodRawShape
|
||||
(plain object of zod fields) OR a full Zod object (verified on 1.29: AnySchema,
|
||||
`.strict()` honored at runtime). Use a strict `z.object` where unknown-key
|
||||
rejection matters (add_connection); raw shapes are fine elsewhere. Subpath
|
||||
imports (`server/mcp.js`, `server/stdio.js`, `client/index.js`, `inMemory.js`,
|
||||
`types.js`)
|
||||
- zod 3 (`import * as z from 'zod'`)
|
||||
|
||||
Reference in New Issue
Block a user