atiaomar1978-hub opened a new pull request, #25398: URL: https://github.com/apache/camel/pull/25398
## Summary _AI-generated on behalf of atiaomar1978-hub_ Implements [CAMEL-24333](https://issues.apache.org/jira/browse/CAMEL-24333): optional structured tool output for `ai-tool` routes, mapped through the MCP server to `Tool.outputSchema` and `CallToolResult.structuredContent`. ### Changes - **ai-tool configuration**: new `outputParameter.*` (flat field syntax) and `outputSchema` (raw JSON Schema), mutually exclusive — mirrors the input-side `parameter.*` / `argSchema` pattern. - **`AiToolResult.Success`**: extended with optional `structuredContent`; populated when an output schema is declared and the route body is JSON (String, Map, or List). - **`AiToolExecutor`**: parses JSON bodies into structured content; invalid JSON returns `ExecutionError`. - **`AiToolComponent`**: extracts `outputParameter.*` URI params (same pattern as existing `parameter.*` handling). - **MCP SPI**: `McpToolCallResult.structuredContent`, `McpServerTool.outputSchemaJson()` default method; bridge and Vert.x engine forward both to the MCP Java SDK. - **LangChain4j / Spring AI adapters**: unchanged — continue using string `value()` only. ### Testing - `AiToolParameterHelperTest` — output schema resolution, structured parsing, mutual exclusivity - `AiToolEndpointLifecycleTest` — endpoint registration with output schema - `AiToolExecutorTest` — structured content from JSON string and Map body - `McpServerBridgeTest` — output schema and structured content passthrough - `VertxMcpServerOutputSchemaTest` — end-to-end MCP client verification ### Documentation - `ai-tool-component.adoc` — new Structured Tool Output section - `camel-4x-upgrade-guide-4_22.adoc` — SPI extension note -- 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]
