gnodet-bot commented on code in PR #30617: URL: https://github.com/apache/camel/pull/30617#discussion_r4659839988
########## docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_24.adoc: ########## @@ -704,6 +704,15 @@ An `AiToolConfiguration` bean given as the `configuration` option no longer repl `allowedRoles`. Previously the bean replaced the options of the endpoint and the values of the component. The bean itself is no longer changed by the options of the endpoints that use it. +=== camel-ai-tool - an argSchema without additionalProperties gets additionalProperties: false + +When the `argSchema` of an `ai-tool` endpoint does not set `additionalProperties`, Camel now adds +`additionalProperties: false` to the schema that it lists to clients and validates, the same as for the schema +generated from `+parameter.*+`. A client that validates the input, such as the MCP server, now refuses a call with an +undeclared argument; previously Camel accepted the call and dropped the argument with a WARN. To accept other Review Comment: 🔤 **STE nit (low):** First sentence is 35 words — split at the period after "validates": ```suggestion When the `argSchema` of an `ai-tool` endpoint does not set `additionalProperties`, Camel now adds `additionalProperties: false` to the schema that it lists to clients and validates. This matches the schema generated from `+parameter.*+`. A client that validates the input, such as the MCP server, now refuses a call with an ``` ########## components/camel-ai/camel-ai-tool/src/main/docs/ai-tool-component.adoc: ########## @@ -196,7 +196,7 @@ Top-level schema properties are exposed as exchange headers. Nested values are p `argSchema` also supports Camel resource references such as `classpath:schemas/create-order.json`. -The root schema must be a JSON Schema object with a top-level `properties` map. Camel always allowlists top-level property names when invoking the tool route, even if the schema sets `additionalProperties: true`. Nested fields are not flattened into headers; only top-level properties become exchange headers (Map/List/primitive values). +The root schema must be a JSON Schema object with a top-level `properties` map. When the schema does not set `additionalProperties`, Camel adds `additionalProperties: false` to the schema it lists and validates, the same as for the schema generated from `+parameter.*+`. A client that validates the input, such as the MCP server, then refuses a call with an undeclared (for example misspelled) argument, instead of Camel dropping it with a warning. A schema that sets `additionalProperties` itself is kept as written. Camel always allowlists top-level property names when invoking the tool route, even if the schema sets `additionalProperties: true`. Nested fields are not flattened into headers; only top-level properties become exchange headers (Map/List/primitive values). Review Comment: 🔤 **STE nit (low):** Two sentences exceed the 25-word readability guideline (27w and 30w). Suggested split: ```suggestion The root schema must be a JSON Schema object with a top-level `properties` map. When the schema does not set `additionalProperties`, Camel adds `additionalProperties: false` to the listed and validated schema. This matches the schema generated from `+parameter.*+`. A validating client such as the MCP server then refuses a call with an undeclared (for example misspelled) argument, instead of Camel dropping it with a warning. A schema that sets `additionalProperties` itself is kept as written. Camel always allowlists top-level property names when invoking the tool route, even if the schema sets `additionalProperties: true`. Nested fields are not flattened into headers; only top-level properties become exchange headers (Map/List/primitive values). ``` -- 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]
