Commit a39bd78
Fix SDK types to align with MCP spec for sampling tools
Changes:
- Remove `disable_parallel_tool_use` from ToolChoiceSchema (not in MCP spec)
- Remove unnecessary `.passthrough()` from ToolChoiceSchema
- Change CreateMessageResultSchema.role from z.literal("assistant") to
z.enum(["user", "assistant"]) to match spec's SamplingMessage.role
- Update spec type count from 123 to 127 (4 new sampling tool types)
- Fix test accessing .type on content union (could be array)
- Add test for CreateMessageResult with array content
- Remove test expecting user role to fail (spec allows both roles)
Note: 7 type compatibility errors remain due to upstream spec issue
where ToolUseContent.input and ToolResultContent.structuredContent use
`object` type instead of `{ [key: string]: unknown }`.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <[email protected]>1 parent d5cc736 commit a39bd78
3 files changed
+231
-232
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
647 | 647 | | |
648 | 648 | | |
649 | 649 | | |
650 | | - | |
| 650 | + | |
651 | 651 | | |
652 | 652 | | |
653 | 653 | | |
| |||
0 commit comments