Skip to content

feat(compat): registerTool/registerPrompt accept raw Zod shape, auto-wrap with z.object() - #1901

Merged
felixweinberger merged 16 commits into
mainfrom
fweinberger/v2-bc-register-rawshape
Apr 29, 2026
Merged

felixweinberger merged 16 commits into
mainfrom
fweinberger/v2-bc-register-rawshape

fix: isZodRawShape treats empty object as raw shape (matches v1)

5266131
Select commit
Loading
Failed to load commit list.
Claude / Claude Code Review completed Apr 16, 2026 in 22m 34s

Code review found 2 potential issues

Found 5 candidates, confirmed 2. See review comments for details.

Details

Severity Count
🔴 Important 0
🟡 Nit 2
🟣 Pre-existing 0
Severity File:Line Issue
🟡 Nit .changeset/register-rawshape-compat.md:6 docs/migration.md and migration-SKILL.md still say raw shapes are not supported
🟡 Nit packages/server/src/server/mcp.ts:877 @deprecated JSDoc contradicts 'first-class' changeset — prior thread not actually resolved

Annotations

Check warning on line 6 in .changeset/register-rawshape-compat.md

See this annotation in the file changed.

@claude claude / Claude Code Review

docs/migration.md and migration-SKILL.md still say raw shapes are not supported

The migration docs still say raw shapes are unsupported: `docs/migration.md:246-248` ("Standard Schema objects required (raw shapes no longer supported)" / "Raw object shapes are no longer accepted") and `docs/migration-SKILL.md:213,501` ("raw shapes … are no longer supported", "**Wrap all raw Zod shapes with `z.object()`**" as a required step). After this PR auto-wraps raw shapes and the changeset declares "Both forms are first-class", those passages contradict the implementation and the publis

Check warning on line 877 in packages/server/src/server/mcp.ts

See this annotation in the file changed.

@claude claude / Claude Code Review

@deprecated JSDoc contradicts 'first-class' changeset — prior thread not actually resolved

The reply on the earlier thread says "both forms are first-class", and the changeset still ships "Both forms are first-class." — but 5266131 *added* `@deprecated Wrap with z.object({...})` to the raw-shape overloads of both `registerTool` and `registerPrompt`, and kept the `LegacyToolCallback`/`LegacyPromptCallback` names. The published CHANGELOG and the published .d.ts will now directly contradict each other (IDEs will strikethrough the very overload the changelog calls first-class). Please act