This is an automated email from the ASF dual-hosted git repository.
davsclaus pushed a commit to branch camel-4.22.x
in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/camel-4.22.x by this push:
new d40bbb223c55 CAMEL-27253: camel-ai-tool - fix tags, error message and
hints docs (4.22.x backport) (#30859)
d40bbb223c55 is described below
commit d40bbb223c55f9de3e6f743581340d9cc58d8d17
Author: Jiří Ondrušek <[email protected]>
AuthorDate: Thu Nov 26 11:39:29 2026 +0100
CAMEL-27253: camel-ai-tool - fix tags, error message and hints docs (4.22.x
backport) (#30859)
Backport of #30491 to camel-4.22.x: documents the default tool pool
behaviour of the tags option and fixes the error message and hints docs
of camel-ai-tool. The generated files are regenerated on 4.22.x.
(cherry picked from commit 04c1c72a79ec4539fe912ba977b37521243445ac)
_Generated with Claude Code on behalf of JiriOndrusek_
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
---
.../resources/org/apache/camel/catalog/components/ai-tool.json | 4 ++--
.../resources/org/apache/camel/catalog/docs/mcp-server.adoc | 2 +-
.../META-INF/org/apache/camel/component/ai/tool/ai-tool.json | 4 ++--
.../org/apache/camel/component/ai/tool/AiToolConfiguration.java | 5 ++++-
.../java/org/apache/camel/component/ai/tool/AiToolEndpoint.java | 2 +-
components/camel-ai/camel-mcp-server/src/main/docs/mcp-server.adoc | 2 +-
.../camel/builder/component/dsl/AiToolComponentBuilderFactory.java | 6 ++++--
.../camel/builder/endpoint/dsl/AiToolEndpointBuilderFactory.java | 6 ++++--
8 files changed, 19 insertions(+), 12 deletions(-)
diff --git
a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/ai-tool.json
b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/ai-tool.json
index bd6e16a25572..eef2e51afe7f 100644
---
a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/ai-tool.json
+++
b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/ai-tool.json
@@ -34,7 +34,7 @@
"parameters": { "index": 7, "kind": "property", "displayName":
"Parameters", "group": "consumer", "label": "consumer", "required": false,
"type": "object", "javaType": "java.util.Map<java.lang.String,
java.lang.String>", "prefix": "parameter.", "multiValue": true, "deprecated":
false, "deprecationNote": "", "autowired": false, "secret": false,
"configurationClass": "org.apache.camel.component.ai.tool.AiToolConfiguration",
"configurationField": "configuration", "description": "Tool in [...]
"readOnlyHint": { "index": 8, "kind": "property", "displayName": "Read
Only Hint", "group": "consumer", "label": "consumer", "required": false,
"type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false,
"deprecationNote": "", "autowired": false, "secret": false, "defaultValue":
false, "configurationClass":
"org.apache.camel.component.ai.tool.AiToolConfiguration", "configurationField":
"configuration", "description": "MCP hint that the tool only reads data and
does not m [...]
"returnDirect": { "index": 9, "kind": "property", "displayName": "Return
Direct", "group": "consumer", "label": "consumer", "required": false, "type":
"boolean", "javaType": "java.lang.Boolean", "deprecated": false,
"deprecationNote": "", "autowired": false, "secret": false, "defaultValue":
false, "configurationClass":
"org.apache.camel.component.ai.tool.AiToolConfiguration", "configurationField":
"configuration", "description": "When true, AI producers that support agentic
tool loop [...]
- "tags": { "index": 10, "kind": "property", "displayName": "Tags", "group":
"consumer", "label": "consumer", "required": false, "type": "string",
"javaType": "java.lang.String", "deprecated": false, "deprecationNote": "",
"autowired": false, "secret": false, "configurationClass":
"org.apache.camel.component.ai.tool.AiToolConfiguration", "configurationField":
"configuration", "description": "Comma-separated list of tags used to group
tools. Producers filter the registry by these tags t [...]
+ "tags": { "index": 10, "kind": "property", "displayName": "Tags", "group":
"consumer", "label": "consumer", "required": false, "type": "string",
"javaType": "java.lang.String", "deprecated": false, "deprecationNote": "",
"autowired": false, "secret": false, "configurationClass":
"org.apache.camel.component.ai.tool.AiToolConfiguration", "configurationField":
"configuration", "description": "Comma-separated list of tags used to group
tools. Producers filter the registry by these tags t [...]
"title": { "index": 11, "kind": "property", "displayName": "Title",
"group": "consumer", "label": "consumer", "required": false, "type": "string",
"javaType": "java.lang.String", "deprecated": false, "deprecationNote": "",
"autowired": false, "secret": false, "configurationClass":
"org.apache.camel.component.ai.tool.AiToolConfiguration", "configurationField":
"configuration", "description": "Optional display title for MCP tool listings.
Advisory hint for MCP clients only." },
"autowiredEnabled": { "index": 12, "kind": "property", "displayName":
"Autowired Enabled", "group": "advanced", "label": "advanced", "required":
false, "type": "boolean", "javaType": "boolean", "deprecated": false,
"autowired": false, "secret": false, "defaultValue": true, "description":
"Whether autowiring is enabled. This is used for automatic autowiring options
(the option must be marked as autowired) by looking up in the registry to find
if there is a single instance of matching [...]
},
@@ -48,7 +48,7 @@
"parameters": { "index": 6, "kind": "parameter", "displayName":
"Parameters", "group": "consumer", "label": "consumer", "required": false,
"type": "object", "javaType": "java.util.Map<java.lang.String,
java.lang.String>", "prefix": "parameter.", "multiValue": true, "deprecated":
false, "deprecationNote": "", "autowired": false, "secret": false,
"configurationClass": "org.apache.camel.component.ai.tool.AiToolConfiguration",
"configurationField": "configuration", "description": "Tool i [...]
"readOnlyHint": { "index": 7, "kind": "parameter", "displayName": "Read
Only Hint", "group": "consumer", "label": "consumer", "required": false,
"type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false,
"deprecationNote": "", "autowired": false, "secret": false, "defaultValue":
false, "configurationClass":
"org.apache.camel.component.ai.tool.AiToolConfiguration", "configurationField":
"configuration", "description": "MCP hint that the tool only reads data and
does not [...]
"returnDirect": { "index": 8, "kind": "parameter", "displayName": "Return
Direct", "group": "consumer", "label": "consumer", "required": false, "type":
"boolean", "javaType": "java.lang.Boolean", "deprecated": false,
"deprecationNote": "", "autowired": false, "secret": false, "defaultValue":
false, "configurationClass":
"org.apache.camel.component.ai.tool.AiToolConfiguration", "configurationField":
"configuration", "description": "When true, AI producers that support agentic
tool loo [...]
- "tags": { "index": 9, "kind": "parameter", "displayName": "Tags", "group":
"consumer", "label": "consumer", "required": false, "type": "string",
"javaType": "java.lang.String", "deprecated": false, "deprecationNote": "",
"autowired": false, "secret": false, "configurationClass":
"org.apache.camel.component.ai.tool.AiToolConfiguration", "configurationField":
"configuration", "description": "Comma-separated list of tags used to group
tools. Producers filter the registry by these tags t [...]
+ "tags": { "index": 9, "kind": "parameter", "displayName": "Tags", "group":
"consumer", "label": "consumer", "required": false, "type": "string",
"javaType": "java.lang.String", "deprecated": false, "deprecationNote": "",
"autowired": false, "secret": false, "configurationClass":
"org.apache.camel.component.ai.tool.AiToolConfiguration", "configurationField":
"configuration", "description": "Comma-separated list of tags used to group
tools. Producers filter the registry by these tags t [...]
"title": { "index": 10, "kind": "parameter", "displayName": "Title",
"group": "consumer", "label": "consumer", "required": false, "type": "string",
"javaType": "java.lang.String", "deprecated": false, "deprecationNote": "",
"autowired": false, "secret": false, "configurationClass":
"org.apache.camel.component.ai.tool.AiToolConfiguration", "configurationField":
"configuration", "description": "Optional display title for MCP tool listings.
Advisory hint for MCP clients only." },
"bridgeErrorHandler": { "index": 11, "kind": "parameter", "displayName":
"Bridge Error Handler", "group": "consumer (advanced)", "label":
"consumer,advanced", "required": false, "type": "boolean", "javaType":
"boolean", "deprecated": false, "autowired": false, "secret": false,
"defaultValue": false, "description": "Allows for bridging the consumer to the
Camel routing Error Handler, which mean any exceptions (if possible) occurred
while the Camel consumer is trying to pickup incoming [...]
"exceptionHandler": { "index": 12, "kind": "parameter", "displayName":
"Exception Handler", "group": "consumer (advanced)", "label":
"consumer,advanced", "required": false, "type": "object", "javaType":
"org.apache.camel.spi.ExceptionHandler", "optionalPrefix": "consumer.",
"deprecated": false, "autowired": false, "secret": false, "description": "To
let the consumer use a custom ExceptionHandler. Notice if the option
bridgeErrorHandler is enabled then this option is not in use. By de [...]
diff --git
a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/mcp-server.adoc
b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/mcp-server.adoc
index 18655e9cee08..05cfd6fabe0e 100644
---
a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/mcp-server.adoc
+++
b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/mcp-server.adoc
@@ -104,7 +104,7 @@ YAML::
=== Tool annotation hints
`ai-tool` routes can declare optional MCP `ToolAnnotations` hints
-(`title`, `readOnlyHint`, `destructiveHint`, `idempotentHint`,
`openWorldHint`).
+(`title`, `readOnlyHint`, `destructiveHint`, `idempotentHint`,
`openWorldHint`, `returnDirect`).
The bridge passes them through to the MCP engine. See
xref:ROOT:ai-tool-component.adoc#_mcp_tool_annotation_hints[MCP Tool
Annotation Hints]
for configuration examples. Hints are advisory UX metadata only — not
authorization.
diff --git
a/components/camel-ai/camel-ai-tool/src/generated/resources/META-INF/org/apache/camel/component/ai/tool/ai-tool.json
b/components/camel-ai/camel-ai-tool/src/generated/resources/META-INF/org/apache/camel/component/ai/tool/ai-tool.json
index bd6e16a25572..eef2e51afe7f 100644
---
a/components/camel-ai/camel-ai-tool/src/generated/resources/META-INF/org/apache/camel/component/ai/tool/ai-tool.json
+++
b/components/camel-ai/camel-ai-tool/src/generated/resources/META-INF/org/apache/camel/component/ai/tool/ai-tool.json
@@ -34,7 +34,7 @@
"parameters": { "index": 7, "kind": "property", "displayName":
"Parameters", "group": "consumer", "label": "consumer", "required": false,
"type": "object", "javaType": "java.util.Map<java.lang.String,
java.lang.String>", "prefix": "parameter.", "multiValue": true, "deprecated":
false, "deprecationNote": "", "autowired": false, "secret": false,
"configurationClass": "org.apache.camel.component.ai.tool.AiToolConfiguration",
"configurationField": "configuration", "description": "Tool in [...]
"readOnlyHint": { "index": 8, "kind": "property", "displayName": "Read
Only Hint", "group": "consumer", "label": "consumer", "required": false,
"type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false,
"deprecationNote": "", "autowired": false, "secret": false, "defaultValue":
false, "configurationClass":
"org.apache.camel.component.ai.tool.AiToolConfiguration", "configurationField":
"configuration", "description": "MCP hint that the tool only reads data and
does not m [...]
"returnDirect": { "index": 9, "kind": "property", "displayName": "Return
Direct", "group": "consumer", "label": "consumer", "required": false, "type":
"boolean", "javaType": "java.lang.Boolean", "deprecated": false,
"deprecationNote": "", "autowired": false, "secret": false, "defaultValue":
false, "configurationClass":
"org.apache.camel.component.ai.tool.AiToolConfiguration", "configurationField":
"configuration", "description": "When true, AI producers that support agentic
tool loop [...]
- "tags": { "index": 10, "kind": "property", "displayName": "Tags", "group":
"consumer", "label": "consumer", "required": false, "type": "string",
"javaType": "java.lang.String", "deprecated": false, "deprecationNote": "",
"autowired": false, "secret": false, "configurationClass":
"org.apache.camel.component.ai.tool.AiToolConfiguration", "configurationField":
"configuration", "description": "Comma-separated list of tags used to group
tools. Producers filter the registry by these tags t [...]
+ "tags": { "index": 10, "kind": "property", "displayName": "Tags", "group":
"consumer", "label": "consumer", "required": false, "type": "string",
"javaType": "java.lang.String", "deprecated": false, "deprecationNote": "",
"autowired": false, "secret": false, "configurationClass":
"org.apache.camel.component.ai.tool.AiToolConfiguration", "configurationField":
"configuration", "description": "Comma-separated list of tags used to group
tools. Producers filter the registry by these tags t [...]
"title": { "index": 11, "kind": "property", "displayName": "Title",
"group": "consumer", "label": "consumer", "required": false, "type": "string",
"javaType": "java.lang.String", "deprecated": false, "deprecationNote": "",
"autowired": false, "secret": false, "configurationClass":
"org.apache.camel.component.ai.tool.AiToolConfiguration", "configurationField":
"configuration", "description": "Optional display title for MCP tool listings.
Advisory hint for MCP clients only." },
"autowiredEnabled": { "index": 12, "kind": "property", "displayName":
"Autowired Enabled", "group": "advanced", "label": "advanced", "required":
false, "type": "boolean", "javaType": "boolean", "deprecated": false,
"autowired": false, "secret": false, "defaultValue": true, "description":
"Whether autowiring is enabled. This is used for automatic autowiring options
(the option must be marked as autowired) by looking up in the registry to find
if there is a single instance of matching [...]
},
@@ -48,7 +48,7 @@
"parameters": { "index": 6, "kind": "parameter", "displayName":
"Parameters", "group": "consumer", "label": "consumer", "required": false,
"type": "object", "javaType": "java.util.Map<java.lang.String,
java.lang.String>", "prefix": "parameter.", "multiValue": true, "deprecated":
false, "deprecationNote": "", "autowired": false, "secret": false,
"configurationClass": "org.apache.camel.component.ai.tool.AiToolConfiguration",
"configurationField": "configuration", "description": "Tool i [...]
"readOnlyHint": { "index": 7, "kind": "parameter", "displayName": "Read
Only Hint", "group": "consumer", "label": "consumer", "required": false,
"type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false,
"deprecationNote": "", "autowired": false, "secret": false, "defaultValue":
false, "configurationClass":
"org.apache.camel.component.ai.tool.AiToolConfiguration", "configurationField":
"configuration", "description": "MCP hint that the tool only reads data and
does not [...]
"returnDirect": { "index": 8, "kind": "parameter", "displayName": "Return
Direct", "group": "consumer", "label": "consumer", "required": false, "type":
"boolean", "javaType": "java.lang.Boolean", "deprecated": false,
"deprecationNote": "", "autowired": false, "secret": false, "defaultValue":
false, "configurationClass":
"org.apache.camel.component.ai.tool.AiToolConfiguration", "configurationField":
"configuration", "description": "When true, AI producers that support agentic
tool loo [...]
- "tags": { "index": 9, "kind": "parameter", "displayName": "Tags", "group":
"consumer", "label": "consumer", "required": false, "type": "string",
"javaType": "java.lang.String", "deprecated": false, "deprecationNote": "",
"autowired": false, "secret": false, "configurationClass":
"org.apache.camel.component.ai.tool.AiToolConfiguration", "configurationField":
"configuration", "description": "Comma-separated list of tags used to group
tools. Producers filter the registry by these tags t [...]
+ "tags": { "index": 9, "kind": "parameter", "displayName": "Tags", "group":
"consumer", "label": "consumer", "required": false, "type": "string",
"javaType": "java.lang.String", "deprecated": false, "deprecationNote": "",
"autowired": false, "secret": false, "configurationClass":
"org.apache.camel.component.ai.tool.AiToolConfiguration", "configurationField":
"configuration", "description": "Comma-separated list of tags used to group
tools. Producers filter the registry by these tags t [...]
"title": { "index": 10, "kind": "parameter", "displayName": "Title",
"group": "consumer", "label": "consumer", "required": false, "type": "string",
"javaType": "java.lang.String", "deprecated": false, "deprecationNote": "",
"autowired": false, "secret": false, "configurationClass":
"org.apache.camel.component.ai.tool.AiToolConfiguration", "configurationField":
"configuration", "description": "Optional display title for MCP tool listings.
Advisory hint for MCP clients only." },
"bridgeErrorHandler": { "index": 11, "kind": "parameter", "displayName":
"Bridge Error Handler", "group": "consumer (advanced)", "label":
"consumer,advanced", "required": false, "type": "boolean", "javaType":
"boolean", "deprecated": false, "autowired": false, "secret": false,
"defaultValue": false, "description": "Allows for bridging the consumer to the
Camel routing Error Handler, which mean any exceptions (if possible) occurred
while the Camel consumer is trying to pickup incoming [...]
"exceptionHandler": { "index": 12, "kind": "parameter", "displayName":
"Exception Handler", "group": "consumer (advanced)", "label":
"consumer,advanced", "required": false, "type": "object", "javaType":
"org.apache.camel.spi.ExceptionHandler", "optionalPrefix": "consumer.",
"deprecated": false, "autowired": false, "secret": false, "description": "To
let the consumer use a custom ExceptionHandler. Notice if the option
bridgeErrorHandler is enabled then this option is not in use. By de [...]
diff --git
a/components/camel-ai/camel-ai-tool/src/main/java/org/apache/camel/component/ai/tool/AiToolConfiguration.java
b/components/camel-ai/camel-ai-tool/src/main/java/org/apache/camel/component/ai/tool/AiToolConfiguration.java
index 6276f3636fd9..33844f1990a1 100644
---
a/components/camel-ai/camel-ai-tool/src/main/java/org/apache/camel/component/ai/tool/AiToolConfiguration.java
+++
b/components/camel-ai/camel-ai-tool/src/main/java/org/apache/camel/component/ai/tool/AiToolConfiguration.java
@@ -37,7 +37,10 @@ public class AiToolConfiguration implements Cloneable {
@Metadata(label = "consumer")
@UriParam(description = "Comma-separated list of tags used to group tools.
"
+ "Producers filter the registry by these tags to
select which tools to expose to the LLM. "
- + "When omitted, the tool goes into a default pool
available to all producers.")
+ + "When omitted, the tool goes into a default pool
that is added to the tools of every tag "
+ + "a producer selects with its own tags option "
+ + "(producers without tags receive no registry
tools, "
+ + "and the MCP server never exposes the default
pool).")
private String tags;
@Metadata(label = "consumer")
diff --git
a/components/camel-ai/camel-ai-tool/src/main/java/org/apache/camel/component/ai/tool/AiToolEndpoint.java
b/components/camel-ai/camel-ai-tool/src/main/java/org/apache/camel/component/ai/tool/AiToolEndpoint.java
index 13959fa36d63..861e1139616e 100644
---
a/components/camel-ai/camel-ai-tool/src/main/java/org/apache/camel/component/ai/tool/AiToolEndpoint.java
+++
b/components/camel-ai/camel-ai-tool/src/main/java/org/apache/camel/component/ai/tool/AiToolEndpoint.java
@@ -64,7 +64,7 @@ public class AiToolEndpoint extends DefaultEndpoint {
public Producer createProducer() {
throw new UnsupportedOperationException(
"ai-tool does not support producer mode. "
- + "Use a framework-specific
component (langchain4j-tools, spring-ai-chat, openai) "
+ + "Use a framework-specific
component (langchain4j-agent, spring-ai-chat, openai) "
+ "with a matching tags
parameter to invoke tools.");
}
diff --git a/components/camel-ai/camel-mcp-server/src/main/docs/mcp-server.adoc
b/components/camel-ai/camel-mcp-server/src/main/docs/mcp-server.adoc
index 18655e9cee08..05cfd6fabe0e 100644
--- a/components/camel-ai/camel-mcp-server/src/main/docs/mcp-server.adoc
+++ b/components/camel-ai/camel-mcp-server/src/main/docs/mcp-server.adoc
@@ -104,7 +104,7 @@ YAML::
=== Tool annotation hints
`ai-tool` routes can declare optional MCP `ToolAnnotations` hints
-(`title`, `readOnlyHint`, `destructiveHint`, `idempotentHint`,
`openWorldHint`).
+(`title`, `readOnlyHint`, `destructiveHint`, `idempotentHint`,
`openWorldHint`, `returnDirect`).
The bridge passes them through to the MCP engine. See
xref:ROOT:ai-tool-component.adoc#_mcp_tool_annotation_hints[MCP Tool
Annotation Hints]
for configuration examples. Hints are advisory UX metadata only — not
authorization.
diff --git
a/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/AiToolComponentBuilderFactory.java
b/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/AiToolComponentBuilderFactory.java
index 9297e65ece11..6d12d3f810f8 100644
---
a/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/AiToolComponentBuilderFactory.java
+++
b/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/AiToolComponentBuilderFactory.java
@@ -250,8 +250,10 @@ public interface AiToolComponentBuilderFactory {
/**
* Comma-separated list of tags used to group tools. Producers filter
* the registry by these tags to select which tools to expose to the
- * LLM. When omitted, the tool goes into a default pool available to
all
- * producers.
+ * LLM. When omitted, the tool goes into a default pool that is added
to
+ * the tools of every tag a producer selects with its own tags option
+ * (producers without tags receive no registry tools, and the MCP
server
+ * never exposes the default pool).
*
* The option is a: <code>java.lang.String</code> type.
*
diff --git
a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/AiToolEndpointBuilderFactory.java
b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/AiToolEndpointBuilderFactory.java
index 64d572cd02df..490d3927d82d 100644
---
a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/AiToolEndpointBuilderFactory.java
+++
b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/AiToolEndpointBuilderFactory.java
@@ -300,8 +300,10 @@ public interface AiToolEndpointBuilderFactory {
/**
* Comma-separated list of tags used to group tools. Producers filter
* the registry by these tags to select which tools to expose to the
- * LLM. When omitted, the tool goes into a default pool available to
all
- * producers.
+ * LLM. When omitted, the tool goes into a default pool that is added
to
+ * the tools of every tag a producer selects with its own tags option
+ * (producers without tags receive no registry tools, and the MCP
server
+ * never exposes the default pool).
*
* The option is a: <code>java.lang.String</code> type.
*