atiaomar1978-hub opened a new pull request, #24881:
URL: https://github.com/apache/camel/pull/24881

   Copy this into your PR:
   
   ---
   
   ## Summary
   
   Fixes [CAMEL-23962](https://issues.apache.org/jira/browse/CAMEL-23962).
   
   `McpToolConverter.convertTool()` previously copied only three keys from the 
MCP tool `inputSchema` into OpenAI `FunctionParameters`: `type`, `properties`, 
and `required`. All other JSON Schema keywords were dropped silently.
   
   That broke schemas from MCP servers using non-trivial definitions — for 
example `$defs`/`definitions` referenced by `$ref`, `additionalProperties` 
(needed for strict function calling), root-level `description`, and 
compositional keywords like `oneOf`/`anyOf`.
   
   This change copies the full `inputSchema` map into `FunctionParameters`, 
defaulting `type` to `"object"` when absent (preserving previous behavior).
   
   ## Changes
   
   - **`McpToolConverter.java`** — Replace allow-list with a full copy of all 
`inputSchema` entries
   - **`McpToolConverterTest.java`** — Add tests for:
     - `$defs`, `additionalProperties`, `description`, `$ref`, and `required` 
preservation
     - Default `type: object` when `type` is missing
   
   ## Test plan
   
   - [x] `McpToolConverterTest` — all 7 tests pass locally
   - [x] `convertPreservesAllInputSchemaKeywords` — verifies full schema 
keywords are forwarded
   - [x] `convertDefaultsTypeToObjectWhenMissing` — verifies 
backward-compatible type default
   
   ---


-- 
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]

Reply via email to