Skip to content

Conversation

@DaleSeo
Copy link
Contributor

@DaleSeo DaleSeo commented Dec 17, 2025

Fixes #1291

Motivation and Context

When using the tool() method with a ZodObject schema like z.object({ message: z.string() }), the SDK was silently treating the schema as annotations instead of a parameter schema.

How Has This Been Tested?

Added some tests to verify that the tool() method handles ZodObject schemas as expected.

Breaking Changes

No breaking changes. This is a backward-compatible bug fix.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update

Checklist

  • I have read the MCP Documentation
  • My code follows the repository's style guidelines
  • New and existing tests pass locally
  • I have added appropriate error handling
  • I have added or updated documentation as needed

Additional context

@pkg-pr-new
Copy link

pkg-pr-new bot commented Dec 17, 2025

Open in StackBlitz

npm i https://pkg.pr.new/modelcontextprotocol/typescript-sdk/@modelcontextprotocol/sdk@1310

commit: 526b97d

@DaleSeo DaleSeo force-pushed the tool-method-zobject-arguments branch from bb99b72 to 502d9c1 Compare December 17, 2025 03:56
@DaleSeo DaleSeo force-pushed the tool-method-zobject-arguments branch from 502d9c1 to 526b97d Compare December 17, 2025 04:03
@DaleSeo DaleSeo marked this pull request as ready for review December 17, 2025 14:16
@DaleSeo DaleSeo requested a review from a team as a code owner December 17, 2025 14:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: server.tool() silently ignores ZodObject schemas and strips all arguments

1 participant