feat!: #697 added tool input arguments validation#873
Conversation
Kehrlann
left a comment
There was a problem hiding this comment.
Now that I'm revisiting this, I'm wondering whether we really want this system property to toggle this on or off.
We're going to ship this in 2.0, let it be a breaking change - after all, servers MUST validate tool inputs.
(And we should probably revisit tool name validation too, then)
mcp-core/src/main/java/io/modelcontextprotocol/util/ToolInputValidator.java
Outdated
Show resolved
Hide resolved
mcp-test/src/test/java/io/modelcontextprotocol/server/ToolInputValidationIntegrationTests.java
Outdated
Show resolved
Hide resolved
mcp-test/src/test/java/io/modelcontextprotocol/server/ToolInputValidationIntegrationTests.java
Outdated
Show resolved
Hide resolved
mcp-test/src/test/java/io/modelcontextprotocol/server/ToolInputValidationIntegrationTests.java
Outdated
Show resolved
Hide resolved
mcp-core/src/main/java/io/modelcontextprotocol/util/ToolInputValidator.java
Outdated
Show resolved
Hide resolved
|
@Kehrlann regarding toggling:
|
|
For toggling, I'm in favor of leaving an option to turn it off. But let's get rid of the system property - we don't use that pattern anywhere else in the codebase. |
|
@Kehrlann: Got it now — you meant we should reconsider using system properties specifically for tool name and input schema validation, not as a full toggle. That definitely makes sense for the input schema validation: I will remove the system property, but keep the toggle in the server builder. For tool names, server builder settings should be enough as well; exposing it as a system property is more the responsibility of a framework as the SDK. WDYT? |
Exactly. For the tool names, you can do it in a separate PR. |
… causes tool execution error. Breaking change, because validation is activated by default
…alidator.java Co-authored-by: Daniel Garnier-Moiroux <daniel.garnier-moiroux@broadcom.com>
…tValidationIntegrationTests.java Co-authored-by: Daniel Garnier-Moiroux <daniel.garnier-moiroux@broadcom.com>
…ge default validation toggle
…chema without unmarshalling
73daf65 to
c094c06
Compare
|
@Kehrlann: I reworked PR with Map<String, Object> input schema |
|
Thanks for your contribution. For info I've simplified the integration test a bit. |
Signed-off-by: Daniel Garnier-Moiroux <git@garnier.wf>
255f080 to
d7a6858
Compare
Added tool input arguments validation causes Tool Execution Error accordingly SEP-1303.
It is breaking change, because tool input validation is activated by default