This is an automated email from the ASF dual-hosted git repository.
davsclaus pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/main by this push:
new 04c1c72a79ec CAMEL-27253: camel-ai-tool - fix tags, error message and
hints docs (#30491)
04c1c72a79ec is described below
commit 04c1c72a79ec4539fe912ba977b37521243445ac
Author: Jiří Ondrušek <[email protected]>
AuthorDate: Fri Nov 20 16:18:35 2026 +0100
CAMEL-27253: camel-ai-tool - fix tags, error message and hints docs (#30491)
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 ffb0d797818a..571edc189eed 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
@@ -38,7 +38,7 @@
"readOnlyHint": { "index": 11, "kind": "property", "displayName": "Read
Only Hint", "group": "consumer", "label": "consumer", "required": false,
"type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false,
"autowired": false, "secret": false, "configurationClass":
"org.apache.camel.component.ai.tool.AiToolConfiguration", "configurationField":
"configuration", "description": "MCP hint that the tool only reads data and
does not modify state. Advisory for MCP clients; not en [...]
"returnDirect": { "index": 12, "kind": "property", "displayName": "Return
Direct", "group": "consumer", "label": "consumer", "required": false, "type":
"boolean", "javaType": "java.lang.Boolean", "deprecated": false, "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 loops (such as camel-opena [...]
"searchable": { "index": 13, "kind": "property", "displayName":
"Searchable", "group": "consumer", "label": "consumer", "required": false,
"type": "boolean", "javaType": "boolean", "deprecated": false, "autowired":
false, "secret": false, "defaultValue": false, "configurationClass":
"org.apache.camel.component.ai.tool.AiToolConfiguration", "configurationField":
"configuration", "description": "When true, this route tool is eligible for
tool search and is omitted from the initial mode [...]
- "tags": { "index": 14, "kind": "property", "displayName": "Tags", "group":
"consumer", "label": "consumer", "required": false, "type": "string",
"javaType": "java.lang.String", "deprecated": false, "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 to select which tools to
[...]
+ "tags": { "index": 14, "kind": "property", "displayName": "Tags", "group":
"consumer", "label": "consumer", "required": false, "type": "string",
"javaType": "java.lang.String", "deprecated": false, "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 to select which tools to
[...]
"title": { "index": 15, "kind": "property", "displayName": "Title",
"group": "consumer", "label": "consumer", "required": false, "type": "string",
"javaType": "java.lang.String", "deprecated": false, "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": 16, "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 [...]
"allowedRoles": { "index": 17, "kind": "property", "displayName": "Allowed
Roles", "group": "security", "label": "consumer,security", "required": false,
"type": "string", "javaType": "java.lang.String", "deprecated": false,
"autowired": false, "secret": false, "configurationClass":
"org.apache.camel.component.ai.tool.AiToolConfiguration", "configurationField":
"configuration", "description": "Comma-separated list of the roles a caller
needs to call the tool, for example finance,contr [...]
@@ -67,7 +67,7 @@
"readOnlyHint": { "index": 10, "kind": "parameter", "displayName": "Read
Only Hint", "group": "consumer", "label": "consumer", "required": false,
"type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false,
"autowired": false, "secret": false, "configurationClass":
"org.apache.camel.component.ai.tool.AiToolConfiguration", "configurationField":
"configuration", "description": "MCP hint that the tool only reads data and
does not modify state. Advisory for MCP clients; not e [...]
"returnDirect": { "index": 11, "kind": "parameter", "displayName": "Return
Direct", "group": "consumer", "label": "consumer", "required": false, "type":
"boolean", "javaType": "java.lang.Boolean", "deprecated": false, "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 loops (such as camel-open [...]
"searchable": { "index": 12, "kind": "parameter", "displayName":
"Searchable", "group": "consumer", "label": "consumer", "required": false,
"type": "boolean", "javaType": "boolean", "deprecated": false, "autowired":
false, "secret": false, "defaultValue": false, "configurationClass":
"org.apache.camel.component.ai.tool.AiToolConfiguration", "configurationField":
"configuration", "description": "When true, this route tool is eligible for
tool search and is omitted from the initial mod [...]
- "tags": { "index": 13, "kind": "parameter", "displayName": "Tags",
"group": "consumer", "label": "consumer", "required": false, "type": "string",
"javaType": "java.lang.String", "deprecated": false, "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 to select which tools t [...]
+ "tags": { "index": 13, "kind": "parameter", "displayName": "Tags",
"group": "consumer", "label": "consumer", "required": false, "type": "string",
"javaType": "java.lang.String", "deprecated": false, "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 to select which tools t [...]
"title": { "index": 14, "kind": "parameter", "displayName": "Title",
"group": "consumer", "label": "consumer", "required": false, "type": "string",
"javaType": "java.lang.String", "deprecated": false, "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": 15, "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": 16, "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 87a1c7b385c5..225a8cc24870 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
@@ -191,7 +191,7 @@ and stdio. Changes to prompt routes are announced with
=== 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 ffb0d797818a..571edc189eed 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
@@ -38,7 +38,7 @@
"readOnlyHint": { "index": 11, "kind": "property", "displayName": "Read
Only Hint", "group": "consumer", "label": "consumer", "required": false,
"type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false,
"autowired": false, "secret": false, "configurationClass":
"org.apache.camel.component.ai.tool.AiToolConfiguration", "configurationField":
"configuration", "description": "MCP hint that the tool only reads data and
does not modify state. Advisory for MCP clients; not en [...]
"returnDirect": { "index": 12, "kind": "property", "displayName": "Return
Direct", "group": "consumer", "label": "consumer", "required": false, "type":
"boolean", "javaType": "java.lang.Boolean", "deprecated": false, "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 loops (such as camel-opena [...]
"searchable": { "index": 13, "kind": "property", "displayName":
"Searchable", "group": "consumer", "label": "consumer", "required": false,
"type": "boolean", "javaType": "boolean", "deprecated": false, "autowired":
false, "secret": false, "defaultValue": false, "configurationClass":
"org.apache.camel.component.ai.tool.AiToolConfiguration", "configurationField":
"configuration", "description": "When true, this route tool is eligible for
tool search and is omitted from the initial mode [...]
- "tags": { "index": 14, "kind": "property", "displayName": "Tags", "group":
"consumer", "label": "consumer", "required": false, "type": "string",
"javaType": "java.lang.String", "deprecated": false, "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 to select which tools to
[...]
+ "tags": { "index": 14, "kind": "property", "displayName": "Tags", "group":
"consumer", "label": "consumer", "required": false, "type": "string",
"javaType": "java.lang.String", "deprecated": false, "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 to select which tools to
[...]
"title": { "index": 15, "kind": "property", "displayName": "Title",
"group": "consumer", "label": "consumer", "required": false, "type": "string",
"javaType": "java.lang.String", "deprecated": false, "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": 16, "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 [...]
"allowedRoles": { "index": 17, "kind": "property", "displayName": "Allowed
Roles", "group": "security", "label": "consumer,security", "required": false,
"type": "string", "javaType": "java.lang.String", "deprecated": false,
"autowired": false, "secret": false, "configurationClass":
"org.apache.camel.component.ai.tool.AiToolConfiguration", "configurationField":
"configuration", "description": "Comma-separated list of the roles a caller
needs to call the tool, for example finance,contr [...]
@@ -67,7 +67,7 @@
"readOnlyHint": { "index": 10, "kind": "parameter", "displayName": "Read
Only Hint", "group": "consumer", "label": "consumer", "required": false,
"type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false,
"autowired": false, "secret": false, "configurationClass":
"org.apache.camel.component.ai.tool.AiToolConfiguration", "configurationField":
"configuration", "description": "MCP hint that the tool only reads data and
does not modify state. Advisory for MCP clients; not e [...]
"returnDirect": { "index": 11, "kind": "parameter", "displayName": "Return
Direct", "group": "consumer", "label": "consumer", "required": false, "type":
"boolean", "javaType": "java.lang.Boolean", "deprecated": false, "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 loops (such as camel-open [...]
"searchable": { "index": 12, "kind": "parameter", "displayName":
"Searchable", "group": "consumer", "label": "consumer", "required": false,
"type": "boolean", "javaType": "boolean", "deprecated": false, "autowired":
false, "secret": false, "defaultValue": false, "configurationClass":
"org.apache.camel.component.ai.tool.AiToolConfiguration", "configurationField":
"configuration", "description": "When true, this route tool is eligible for
tool search and is omitted from the initial mod [...]
- "tags": { "index": 13, "kind": "parameter", "displayName": "Tags",
"group": "consumer", "label": "consumer", "required": false, "type": "string",
"javaType": "java.lang.String", "deprecated": false, "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 to select which tools t [...]
+ "tags": { "index": 13, "kind": "parameter", "displayName": "Tags",
"group": "consumer", "label": "consumer", "required": false, "type": "string",
"javaType": "java.lang.String", "deprecated": false, "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 to select which tools t [...]
"title": { "index": 14, "kind": "parameter", "displayName": "Title",
"group": "consumer", "label": "consumer", "required": false, "type": "string",
"javaType": "java.lang.String", "deprecated": false, "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": 15, "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": 16, "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 67f49547bff4..1144f27d9458 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
@@ -38,7 +38,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 f85439260633..9a559de41130 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
@@ -78,7 +78,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 87a1c7b385c5..225a8cc24870 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
@@ -191,7 +191,7 @@ and stdio. Changes to prompt routes are announced with
=== 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 8448ba04a3c9..79712352bbc6 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
@@ -324,8 +324,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 11a5b7aa49ee..bd25013aab9c 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
@@ -430,8 +430,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.
*