You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Claus Ibsen (Jira)" <ji...@apache.org> on 2026/08/25 17:23:00 UTC

[jira] [Commented] (CAMEL-23397) camel-openai: Support tool annotations/hints for returnDirect and safety classification

    [ https://issues.apache.org/jira/browse/CAMEL-23397?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18108024#comment-18108024 ] 

Claus Ibsen commented on CAMEL-23397:
-------------------------------------

Fixed via merged PR: https://github.com/apache/camel/pull/25497 (commit 2c3b65a8af54a4cc30278ea4e6df8be757b709ba)

> camel-openai: Support tool annotations/hints for returnDirect and safety classification
> ---------------------------------------------------------------------------------------
>
>                 Key: CAMEL-23397
>                 URL: https://issues.apache.org/jira/browse/CAMEL-23397
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-openai
>            Reporter: Federico Mariani
>            Assignee: Omar Atie
>            Priority: Minor
>             Fix For: 4.23.0
>
>
> Extends [CAMEL-23382|https://issues.apache.org/jira/browse/CAMEL-23382]
> The MCP integration in _camel-openai_ already supports rich tool metadata via MCP tool annotations:
> - _returnDirect_: short-circuit the agentic loop and return the tool result directly to the caller
> - `readOnlyHint`, `destructiveHint`, `openWorldHint`: safety classification hints
> However, these annotations are only available for MCP-sourced tools. When [CAMEL-23382|https://issues.apache.org/jira/browse/CAMEL-23382] introduces route-based tools via `AiToolSpec`, those tools will lack this metadata, making them less capable than MCP tools used through the same agentic loop.
> *Proposed changes:*
> The `AiToolSpec` defined in CAMEL-23382 should include an extensible annotations mechanism:
> - `returnDirect` (boolean, default false) — when true, the agentic loop returns the tool result directly without sending it back to the model. This is critical for tools that produce final output (e.g., "generate report", "fetch file").
> The agentic loop should treat annotations uniformly regardless of whether the tool came from MCP or from the Camel route-based registry. This means the `AiToolRegistry` lookup should return annotations alongside the tool spec.
> *Example usage:*
> ```yaml
> - from:
>     uri: "ai-tools:generateReport"
>     parameters:
>       description: "Generate a PDF report from the given data"
>       returnDirect: true
>     steps:
>       - to: "pdf:create"
> ```



--
This message was sent by Atlassian Jira
(v8.20.10#820010)