davsclaus opened a new pull request, #30617: URL: https://github.com/apache/camel/pull/30617
## Summary [CAMEL-27405](https://issues.apache.org/jira/browse/CAMEL-27405), found while adding the ai-tool-source Kamelet (apache/camel-kamelets#3364). A tool that declares its arguments with `parameter.*` gets a generated input schema with `additionalProperties: false`, so the MCP server (the SDK validates the input) refuses a call with an undeclared argument. A tool with `argSchema` used the schema as written: JSON Schema allows other properties unless the schema says otherwise, so the call went through and `AiToolExecutor` dropped the extra argument with only a WARN. The client never learned that it sent a wrong (for example misspelled) argument. - `AiToolParameterHelper.resolveArgSchema`: when the root schema does not set `additionalProperties`, add `additionalProperties: false` to the schema that Camel lists and validates. A schema that sets `additionalProperties` itself (`true`, `false` or a schema) is kept as written. Nested objects are not changed. - `argSchema` option description and the component docs say so; upgrade-guide entry for 4.24 (the MCP server now refuses such a call). - `CamelAiToolCallId` header description and the "Invocation Identifiers" docs: set when an in-process producer such as `openai` or `langchain4j-agent` calls the tool, not for a call over MCP, where the bridge has no tool call id. - Regenerated the catalog JSON and docs copy, endpoint DSL and component DSL. ## Tests - `AiToolParameterHelperTest`: `additionalProperties: false` added when absent (with and without a root `type`), kept when `true` or schema-valued, nested objects untouched. `camel-ai-tool`: 212 tests pass. - `McpServerConformanceTestSupport` (run by `VertxMcpServerConformanceTest`): an `argSchema` tool lists `additionalProperties: false`, and a call with an undeclared argument is refused, for both `argSchema` and `parameter.*` tools. The two `argSchema` tests fail without the fix and pass with it. _Claude Code on behalf of davsclaus_ 🤖 Generated with [Claude Code](https://claude.com/claude-code) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
