Skip to content

Commit a39bd78

Browse files
bhosmer-antclaude
andcommitted
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

File tree

3 files changed

+231
-232
lines changed

3 files changed

+231
-232
lines changed

src/spec.types.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -647,7 +647,7 @@ describe('Spec Types', () => {
647647
it('should define some expected types', () => {
648648
expect(specTypes).toContain('JSONRPCNotification');
649649
expect(specTypes).toContain('ElicitResult');
650-
expect(specTypes).toHaveLength(123);
650+
expect(specTypes).toHaveLength(127);
651651
});
652652

653653
it('should have up to date list of missing sdk types', () => {

0 commit comments

Comments
 (0)