Fix/stale tool params 988#1107
Draft
olaservo wants to merge 2 commits intomodelcontextprotocol:mainfrom
Draft
Conversation
The MCP spec allows `content` to be a human-readable summary rather than a JSON-stringified copy of `structuredContent`. Remove the yellow warning that was shown when no text block JSON-matched structuredContent, keeping only the positive blue indicator when a match does exist. Fixes modelcontextprotocol#1089 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…l#988) The Run Tool handler read params from React state immediately after calling validateJson(), but setState is async so the values were stale. - Have validateJson() return the parsed value so the caller can use it directly without waiting for React's next render cycle - Rewrite checkValidationErrors to collect fresh values from each form ref and merge them into params before calling callTool - Convert all setParams({...params}) calls to use the functional updater form setParams(prev => ({...prev})) to prevent stale closures when rapidly editing multiple fields - Add regression test that verifies fresh values are sent even within the 300ms debounce window Fixes modelcontextprotocol#988 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Type of Change
Changes Made
Related Issues
Testing
Test Results and/or Instructions
Screenshots are encouraged to share your testing results for this change.
Checklist
npm run prettier-fix)Breaking Changes
Additional Context