I'd like to add some additional context: currently, the Java SDK validates tool output parameters, against the outputSchema, but does not validate tool input parameters against the inputSchema by default. According to the MCP specification, servers MUST validate all tool inputs.
As part of this issue, we plan to:
Implement input schema validation for tool arguments
Enable this validation by default to align with the specification requirements
Please note: This change may not be backward compatible with existing implementations. Some tools that currently work may fail validation if their input schemas are not correctly defined. However, this change is necessary to ensure compliance with the MCP specification.
Tracking: modelcontextprotocol/modelcontextprotocol#1303