Skip to content

Conversation

@filip-bartuska-ipf
Copy link
Contributor

@filip-bartuska-ipf filip-bartuska-ipf commented Dec 1, 2025

Fixing seemingly carried over types/expectations from Zod V3 into Zod V4, which test for internal properties which no longer exist, which caused optional properties to not be identified and propagated in prompts in Zod V4.

Motivation and Context

Fixes a bug, which makes optional fields impossible in prompts using Zod V4.
Bug/issue description: #1198

How Has This Been Tested?

Reproduced and tested using a unit test.
I've also tested it in our internal code, which is the main reason for this MR.

Breaking Changes

Potentially, as the behavior changes from ignoring optional properties to properly propagating them.

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

@filip-bartuska-ipf filip-bartuska-ipf requested a review from a team as a code owner December 1, 2025 11:35
@pkg-pr-new
Copy link

pkg-pr-new bot commented Dec 1, 2025

Open in StackBlitz

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

commit: 5240690

@filip-bartuska-ipf filip-bartuska-ipf force-pushed the optional-prompt-arg-reproduce branch from 36369f4 to 4c9cb56 Compare December 1, 2025 11:42
Copy link
Contributor

@mattzcarey mattzcarey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. tested and approved

@felixweinberger felixweinberger merged commit 5aaf6ee into modelcontextprotocol:main Dec 1, 2025
6 checks passed
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.

3 participants