-
Notifications
You must be signed in to change notification settings - Fork 774
fix: Validate JSON parameters before tool execution #528
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
fix: Validate JSON parameters before tool execution #528
Conversation
Prevents execution of tools with invalid JSON parameters by validating JSON syntax before tool execution and showing error UI for invalid input. - Add validateJson method to DynamicJsonForm via forwardRef - Add validation check in ToolsTab before tool execution - Reuse existing JsonEditor error display for consistent UX
c524a16
to
d65ed01
Compare
Hi @nandsha thanks for this PR! Just wanted to give a heads up: we recently merged in a fairly large set of changes to the JSON schema handling behind the scenes, so I'm taking a little time to go through regression scenarios from other past issues before merging in more large changes to tool input validation. Will dig into this one next. |
Integrate JSON validation with copy JSON functionality: - Maintain forwardRef structure for validation exposure - Combine copy button with validation method - Both features working together without conflicts
Resolved merge conflicts and tested successfully. Thanks @olaservo |
- Merged JSON validation functionality from PR branch with enhanced form features from main - Preserved validateJson method and DynamicJsonFormRef interface for tool validation - Added support for oneOf schemas, enum dropdowns, and enhanced string field types - Integrated meta display functionality and resource content props - Maintained JSON validation before tool execution to prevent invalid data submission
Summary
Motivation and Context
Prevents execution of tools with invalid JSON parameters by validating JSON syntax before tool execution and showing error UI for invalid input.
How Has This Been Tested?
Yes
mcp-inspector-fix-for-issue-498.mov
Breaking Changes
No breaking changes
Types of changes
Checklist