You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: add optional strict parameter to registerTool for Zod validation
Add strict parameter to registerTool config that defaults to false for
backward compatibility. When strict=true, applies .strict() to Zod
schema creation for tool input validation to throw errors on unknown
parameters instead of silently ignoring them.
- Add strict?: boolean to registerTool config interface
- Modify _createRegisteredTool to accept and use strict parameter
- Apply z.object(inputSchema).strict() when strict=true
- Update legacy tool() method to pass strict=false (backward compatibility)
- Update test to verify strict validation rejects unknown parameters
- All existing tests continue to pass (no breaking changes)
This fixes the issue where parameter name typos are silently dropped,
leading to confusing behavior where tools execute with missing data.
0 commit comments