typescript-sdk/.changeset/register-rawshape-compat.md
Felix Weinberger e15a8ef3be
feat(compat): registerTool/registerPrompt accept raw Zod shape, auto-wrap with z.object() (#1901)
Co-authored-by: Konstantin Konstantinov <KKonstantinov@users.noreply.github.com>
2026-04-29 16:34:01 +01:00

530 B

@modelcontextprotocol/core @modelcontextprotocol/server
patch 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.