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
commit 03d5b4b54cca6a3cf14938b7e089b303bac965d1 Author: Claus Ibsen <[email protected]> AuthorDate: Fri Nov 27 11:04:38 2026 +0100 CAMEL-23832: camel-ai-tool - improve the component and option descriptions This commit rewrites the component description and the texts of 11 options of ai-tool (9 shared by the component and the endpoint, the component configuration and the toolName path), 21 texts in the component JSON. The headers keep their texts. returnDirect now says that openai ends its tool loop only when every tool of the turn sets it, argumentsAsBody that the route otherwise starts without a body, and parameter.NAME that an unknown TYPE is taken as string. Documentation only, no behavior change. The component JSON, the catalog copy, the doc page header and the DSL are regenerated. camel-ai-tool is marked as done in tasks/component-descriptions.md. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Claus Ibsen <[email protected]> --- .../apache/camel/catalog/components/ai-tool.json | 42 +++--- .../camel/catalog/docs/ai-tool-component.adoc | 2 +- .../apache/camel/component/ai/tool/ai-tool.json | 42 +++--- .../src/main/docs/ai-tool-component.adoc | 2 +- .../camel/component/ai/tool/AiToolComponent.java | 3 +- .../component/ai/tool/AiToolConfiguration.java | 78 +++++----- .../camel/component/ai/tool/AiToolEndpoint.java | 8 +- .../component/ComponentsBuilderFactory.java | 4 +- .../dsl/AiToolComponentBuilderFactory.java | 100 +++++++------ .../builder/endpoint/EndpointHeaderBuilders.java | 4 +- .../builder/endpoint/StaticEndpointBuilders.java | 18 ++- .../endpoint/dsl/AiToolEndpointBuilderFactory.java | 157 ++++++++++++--------- tasks/component-descriptions.md | 2 +- 13 files changed, 256 insertions(+), 206 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 a8f5e0c4968c..93e23d950f73 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 @@ -3,7 +3,7 @@ "kind": "component", "name": "ai-tool", "title": "AI Tool", - "description": "Framework-agnostic consumer endpoint that registers a Camel route as an LLM tool in the shared AiToolRegistry.", + "description": "Expose a Camel route as a tool that a model calls through a Camel AI producer, or that MCP clients call through the Camel MCP server.", "deprecated": false, "firstVersion": "4.22.0", "label": "ai", @@ -24,22 +24,22 @@ "remote": false }, "componentProperties": { - "argSchema": { "index": 0, "kind": "property", "displayName": "Arg Schema", "group": "consumer", "label": "consumer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "supportFileReference": true, "configurationClass": "org.apache.camel.component.ai.tool.AiToolConfiguration", "configurationField": "configuration", "description": "Raw JSON Schema for tool input parameters. Supports inline JSON and resource r [...] - "argumentsAsBody": { "index": 1, "kind": "property", "displayName": "Arguments As Body", "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": "Whether to populate the message body with the tool arguments as a JSON string, e [...] + "argSchema": { "index": 0, "kind": "property", "displayName": "Arg Schema", "group": "consumer", "label": "consumer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "supportFileReference": true, "configurationClass": "org.apache.camel.component.ai.tool.AiToolConfiguration", "configurationField": "configuration", "description": "The JSON Schema of the tool input, inline or loaded from a resource such as cl [...] + "argumentsAsBody": { "index": 1, "kind": "property", "displayName": "Arguments As Body", "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": "Whether the route also receives the arguments of the call as a JSON object in th [...] "bridgeErrorHandler": { "index": 2, "kind": "property", "displayName": "Bridge Error Handler", "group": "consumer", "label": "consumer", "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 messages, or the like [...] - "configuration": { "index": 3, "kind": "property", "displayName": "Configuration", "group": "consumer", "label": "", "required": false, "type": "object", "javaType": "org.apache.camel.component.ai.tool.AiToolConfiguration", "deprecated": false, "autowired": false, "secret": false, "description": "The component configuration" }, - "description": { "index": 4, "kind": "property", "displayName": "Description", "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": "Human-readable description of what this tool does. Passed verbatim to the LLM; be precise and action-orie [...] + "configuration": { "index": 3, "kind": "property", "displayName": "Configuration", "group": "consumer", "label": "", "required": false, "type": "object", "javaType": "org.apache.camel.component.ai.tool.AiToolConfiguration", "deprecated": false, "autowired": false, "secret": false, "description": "The configuration that every endpoint starts from. The endpoint copies it, and the options of the endpoint URI replace its values." }, + "description": { "index": 4, "kind": "property", "displayName": "Description", "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": "The description of what the tool does, which the model reads as is to decide when to call the tool, and w [...] "destructiveHint": { "index": 5, "kind": "property", "displayName": "Destructive 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 may perform destructive or irreversible updates. Advisory for MCP clien [...] "idempotentHint": { "index": 6, "kind": "property", "displayName": "Idempotent 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 repeating the tool call with the same arguments has no additional effect. Advisory [...] "openWorldHint": { "index": 7, "kind": "property", "displayName": "Open World 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 interacts with external systems outside the application's control. Advisor [...] - "outputParameters": { "index": 8, "kind": "property", "displayName": "Output Parameters", "group": "consumer", "label": "consumer", "required": false, "type": "object", "javaType": "java.util.Map<java.lang.String, java.lang.String>", "prefix": "outputParameter.", "multiValue": true, "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.ai.tool.AiToolConfiguration", "configurationField": "configuration", "description": "Tool output [...] - "outputSchema": { "index": 9, "kind": "property", "displayName": "Output Schema", "group": "consumer", "label": "consumer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "supportFileReference": true, "configurationClass": "org.apache.camel.component.ai.tool.AiToolConfiguration", "configurationField": "configuration", "description": "Raw JSON Schema describing the tool's structured output. Supports inline [...] - "parameters": { "index": 10, "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, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.ai.tool.AiToolConfiguration", "configurationField": "configuration", "description": "Tool input parameters. Format [...] + "outputParameters": { "index": 8, "kind": "property", "displayName": "Output Parameters", "group": "consumer", "label": "consumer", "required": false, "type": "object", "javaType": "java.util.Map<java.lang.String, java.lang.String>", "prefix": "outputParameter.", "multiValue": true, "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.ai.tool.AiToolConfiguration", "configurationField": "configuration", "description": "The fields [...] + "outputSchema": { "index": 9, "kind": "property", "displayName": "Output Schema", "group": "consumer", "label": "consumer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "supportFileReference": true, "configurationClass": "org.apache.camel.component.ai.tool.AiToolConfiguration", "configurationField": "configuration", "description": "The JSON Schema of the structured output of the tool, inline or loaded f [...] + "parameters": { "index": 10, "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, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.ai.tool.AiToolConfiguration", "configurationField": "configuration", "description": "The input parameters of the t [...] "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 [...] + "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": "Whether the openai producer ends its tool loop with the result of this tool [...] "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 [...] - "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." }, + "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": "A comma-separated list of tags to register the tool under. An AI producer (such as openai, langchain4j-agent or spring [...] + "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": "The human-readable title of the tool, which MCP clients can show in tools\/list instead of the name. The AI producer [...] "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 [...] "allRolesRequired": { "index": 18, "kind": "property", "displayName": "All Roles Required", "group": "security", "label": "consumer,security", "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": "Whether the caller needs all the roles in allowedRoles, rather than [...] @@ -54,21 +54,21 @@ "consumerReply": { "carriers": [ "any" ], "dependsOn": [ "outputSchema", "outputParameters" ], "description": "The tool result, as text: the body converted to a String, so a Map, a List or a POJO is sent as its toString(): marshal it to JSON first. No body gives No result. With outputSchema or outputParameter.NAME options the body must be JSON: a JSON String, a Map, a List, a number or a boolean, and bytes, a stream or another object fail the call" } }, "properties": { - "toolName": { "index": 0, "kind": "path", "displayName": "Tool Name", "group": "consumer", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The tool name. This is the name the LLM sees and uses to invoke the tool." }, - "argSchema": { "index": 1, "kind": "parameter", "displayName": "Arg Schema", "group": "consumer", "label": "consumer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "supportFileReference": true, "configurationClass": "org.apache.camel.component.ai.tool.AiToolConfiguration", "configurationField": "configuration", "description": "Raw JSON Schema for tool input parameters. Supports inline JSON and resource [...] - "argumentsAsBody": { "index": 2, "kind": "parameter", "displayName": "Arguments As Body", "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": "Whether to populate the message body with the tool arguments as a JSON string, [...] - "description": { "index": 3, "kind": "parameter", "displayName": "Description", "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": "Human-readable description of what this tool does. Passed verbatim to the LLM; be precise and action-ori [...] + "toolName": { "index": 0, "kind": "path", "displayName": "Tool Name", "group": "consumer", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The name of the tool, which the model sees and uses to call it, and which MCP clients see in tools\/list. It must not contain a slash. A route whose tool name is already registered under one of its tags, or in the pool of tools without tags, [...] + "argSchema": { "index": 1, "kind": "parameter", "displayName": "Arg Schema", "group": "consumer", "label": "consumer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "supportFileReference": true, "configurationClass": "org.apache.camel.component.ai.tool.AiToolConfiguration", "configurationField": "configuration", "description": "The JSON Schema of the tool input, inline or loaded from a resource such as c [...] + "argumentsAsBody": { "index": 2, "kind": "parameter", "displayName": "Arguments As Body", "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": "Whether the route also receives the arguments of the call as a JSON object in t [...] + "description": { "index": 3, "kind": "parameter", "displayName": "Description", "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": "The description of what the tool does, which the model reads as is to decide when to call the tool, and [...] "destructiveHint": { "index": 4, "kind": "parameter", "displayName": "Destructive 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 may perform destructive or irreversible updates. Advisory for MCP clie [...] "idempotentHint": { "index": 5, "kind": "parameter", "displayName": "Idempotent 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 repeating the tool call with the same arguments has no additional effect. Advisor [...] "openWorldHint": { "index": 6, "kind": "parameter", "displayName": "Open World 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 interacts with external systems outside the application's control. Adviso [...] - "outputParameters": { "index": 7, "kind": "parameter", "displayName": "Output Parameters", "group": "consumer", "label": "consumer", "required": false, "type": "object", "javaType": "java.util.Map<java.lang.String, java.lang.String>", "prefix": "outputParameter.", "multiValue": true, "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.ai.tool.AiToolConfiguration", "configurationField": "configuration", "description": "Tool outpu [...] - "outputSchema": { "index": 8, "kind": "parameter", "displayName": "Output Schema", "group": "consumer", "label": "consumer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "supportFileReference": true, "configurationClass": "org.apache.camel.component.ai.tool.AiToolConfiguration", "configurationField": "configuration", "description": "Raw JSON Schema describing the tool's structured output. Supports inlin [...] - "parameters": { "index": 9, "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, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.ai.tool.AiToolConfiguration", "configurationField": "configuration", "description": "Tool input parameters. Format [...] + "outputParameters": { "index": 7, "kind": "parameter", "displayName": "Output Parameters", "group": "consumer", "label": "consumer", "required": false, "type": "object", "javaType": "java.util.Map<java.lang.String, java.lang.String>", "prefix": "outputParameter.", "multiValue": true, "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.ai.tool.AiToolConfiguration", "configurationField": "configuration", "description": "The fields [...] + "outputSchema": { "index": 8, "kind": "parameter", "displayName": "Output Schema", "group": "consumer", "label": "consumer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "supportFileReference": true, "configurationClass": "org.apache.camel.component.ai.tool.AiToolConfiguration", "configurationField": "configuration", "description": "The JSON Schema of the structured output of the tool, inline or loaded [...] + "parameters": { "index": 9, "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, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.ai.tool.AiToolConfiguration", "configurationField": "configuration", "description": "The input parameters of the t [...] "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 [...] + "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": "Whether the openai producer ends its tool loop with the result of this tool [...] "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 [...] - "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." }, + "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": "A comma-separated list of tags to register the tool under. An AI producer (such as openai, langchain4j-agent or sprin [...] + "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": "The human-readable title of the tool, which MCP clients can show in tools\/list instead of the name. The AI produce [...] "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 [...] "exchangePattern": { "index": 17, "kind": "parameter", "displayName": "Exchange Pattern", "group": "consumer (advanced)", "label": "consumer,advanced", "required": false, "type": "enum", "javaType": "org.apache.camel.ExchangePattern", "enum": [ "InOnly", "InOut" ], "deprecated": false, "autowired": false, "secret": false, "description": "Sets the exchange pattern when the consumer creates an exchange." }, diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/ai-tool-component.adoc b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/ai-tool-component.adoc index 3250c86284fe..f4fc3e795d8b 100644 --- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/ai-tool-component.adoc +++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/ai-tool-component.adoc @@ -2,7 +2,7 @@ :doctitle: AI Tool :shortname: ai-tool :artifactid: camel-ai-tool -:description: Framework-agnostic consumer endpoint that registers a Camel route as an LLM tool in the shared AiToolRegistry. +:description: Expose a Camel route as a tool that a model calls through a Camel AI producer, or that MCP clients call through the Camel MCP server. :since: 4.22 :supportlevel: Preview :tabs-sync-option: 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 a8f5e0c4968c..93e23d950f73 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 @@ -3,7 +3,7 @@ "kind": "component", "name": "ai-tool", "title": "AI Tool", - "description": "Framework-agnostic consumer endpoint that registers a Camel route as an LLM tool in the shared AiToolRegistry.", + "description": "Expose a Camel route as a tool that a model calls through a Camel AI producer, or that MCP clients call through the Camel MCP server.", "deprecated": false, "firstVersion": "4.22.0", "label": "ai", @@ -24,22 +24,22 @@ "remote": false }, "componentProperties": { - "argSchema": { "index": 0, "kind": "property", "displayName": "Arg Schema", "group": "consumer", "label": "consumer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "supportFileReference": true, "configurationClass": "org.apache.camel.component.ai.tool.AiToolConfiguration", "configurationField": "configuration", "description": "Raw JSON Schema for tool input parameters. Supports inline JSON and resource r [...] - "argumentsAsBody": { "index": 1, "kind": "property", "displayName": "Arguments As Body", "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": "Whether to populate the message body with the tool arguments as a JSON string, e [...] + "argSchema": { "index": 0, "kind": "property", "displayName": "Arg Schema", "group": "consumer", "label": "consumer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "supportFileReference": true, "configurationClass": "org.apache.camel.component.ai.tool.AiToolConfiguration", "configurationField": "configuration", "description": "The JSON Schema of the tool input, inline or loaded from a resource such as cl [...] + "argumentsAsBody": { "index": 1, "kind": "property", "displayName": "Arguments As Body", "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": "Whether the route also receives the arguments of the call as a JSON object in th [...] "bridgeErrorHandler": { "index": 2, "kind": "property", "displayName": "Bridge Error Handler", "group": "consumer", "label": "consumer", "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 messages, or the like [...] - "configuration": { "index": 3, "kind": "property", "displayName": "Configuration", "group": "consumer", "label": "", "required": false, "type": "object", "javaType": "org.apache.camel.component.ai.tool.AiToolConfiguration", "deprecated": false, "autowired": false, "secret": false, "description": "The component configuration" }, - "description": { "index": 4, "kind": "property", "displayName": "Description", "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": "Human-readable description of what this tool does. Passed verbatim to the LLM; be precise and action-orie [...] + "configuration": { "index": 3, "kind": "property", "displayName": "Configuration", "group": "consumer", "label": "", "required": false, "type": "object", "javaType": "org.apache.camel.component.ai.tool.AiToolConfiguration", "deprecated": false, "autowired": false, "secret": false, "description": "The configuration that every endpoint starts from. The endpoint copies it, and the options of the endpoint URI replace its values." }, + "description": { "index": 4, "kind": "property", "displayName": "Description", "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": "The description of what the tool does, which the model reads as is to decide when to call the tool, and w [...] "destructiveHint": { "index": 5, "kind": "property", "displayName": "Destructive 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 may perform destructive or irreversible updates. Advisory for MCP clien [...] "idempotentHint": { "index": 6, "kind": "property", "displayName": "Idempotent 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 repeating the tool call with the same arguments has no additional effect. Advisory [...] "openWorldHint": { "index": 7, "kind": "property", "displayName": "Open World 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 interacts with external systems outside the application's control. Advisor [...] - "outputParameters": { "index": 8, "kind": "property", "displayName": "Output Parameters", "group": "consumer", "label": "consumer", "required": false, "type": "object", "javaType": "java.util.Map<java.lang.String, java.lang.String>", "prefix": "outputParameter.", "multiValue": true, "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.ai.tool.AiToolConfiguration", "configurationField": "configuration", "description": "Tool output [...] - "outputSchema": { "index": 9, "kind": "property", "displayName": "Output Schema", "group": "consumer", "label": "consumer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "supportFileReference": true, "configurationClass": "org.apache.camel.component.ai.tool.AiToolConfiguration", "configurationField": "configuration", "description": "Raw JSON Schema describing the tool's structured output. Supports inline [...] - "parameters": { "index": 10, "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, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.ai.tool.AiToolConfiguration", "configurationField": "configuration", "description": "Tool input parameters. Format [...] + "outputParameters": { "index": 8, "kind": "property", "displayName": "Output Parameters", "group": "consumer", "label": "consumer", "required": false, "type": "object", "javaType": "java.util.Map<java.lang.String, java.lang.String>", "prefix": "outputParameter.", "multiValue": true, "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.ai.tool.AiToolConfiguration", "configurationField": "configuration", "description": "The fields [...] + "outputSchema": { "index": 9, "kind": "property", "displayName": "Output Schema", "group": "consumer", "label": "consumer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "supportFileReference": true, "configurationClass": "org.apache.camel.component.ai.tool.AiToolConfiguration", "configurationField": "configuration", "description": "The JSON Schema of the structured output of the tool, inline or loaded f [...] + "parameters": { "index": 10, "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, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.ai.tool.AiToolConfiguration", "configurationField": "configuration", "description": "The input parameters of the t [...] "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 [...] + "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": "Whether the openai producer ends its tool loop with the result of this tool [...] "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 [...] - "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." }, + "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": "A comma-separated list of tags to register the tool under. An AI producer (such as openai, langchain4j-agent or spring [...] + "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": "The human-readable title of the tool, which MCP clients can show in tools\/list instead of the name. The AI producer [...] "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 [...] "allRolesRequired": { "index": 18, "kind": "property", "displayName": "All Roles Required", "group": "security", "label": "consumer,security", "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": "Whether the caller needs all the roles in allowedRoles, rather than [...] @@ -54,21 +54,21 @@ "consumerReply": { "carriers": [ "any" ], "dependsOn": [ "outputSchema", "outputParameters" ], "description": "The tool result, as text: the body converted to a String, so a Map, a List or a POJO is sent as its toString(): marshal it to JSON first. No body gives No result. With outputSchema or outputParameter.NAME options the body must be JSON: a JSON String, a Map, a List, a number or a boolean, and bytes, a stream or another object fail the call" } }, "properties": { - "toolName": { "index": 0, "kind": "path", "displayName": "Tool Name", "group": "consumer", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The tool name. This is the name the LLM sees and uses to invoke the tool." }, - "argSchema": { "index": 1, "kind": "parameter", "displayName": "Arg Schema", "group": "consumer", "label": "consumer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "supportFileReference": true, "configurationClass": "org.apache.camel.component.ai.tool.AiToolConfiguration", "configurationField": "configuration", "description": "Raw JSON Schema for tool input parameters. Supports inline JSON and resource [...] - "argumentsAsBody": { "index": 2, "kind": "parameter", "displayName": "Arguments As Body", "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": "Whether to populate the message body with the tool arguments as a JSON string, [...] - "description": { "index": 3, "kind": "parameter", "displayName": "Description", "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": "Human-readable description of what this tool does. Passed verbatim to the LLM; be precise and action-ori [...] + "toolName": { "index": 0, "kind": "path", "displayName": "Tool Name", "group": "consumer", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The name of the tool, which the model sees and uses to call it, and which MCP clients see in tools\/list. It must not contain a slash. A route whose tool name is already registered under one of its tags, or in the pool of tools without tags, [...] + "argSchema": { "index": 1, "kind": "parameter", "displayName": "Arg Schema", "group": "consumer", "label": "consumer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "supportFileReference": true, "configurationClass": "org.apache.camel.component.ai.tool.AiToolConfiguration", "configurationField": "configuration", "description": "The JSON Schema of the tool input, inline or loaded from a resource such as c [...] + "argumentsAsBody": { "index": 2, "kind": "parameter", "displayName": "Arguments As Body", "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": "Whether the route also receives the arguments of the call as a JSON object in t [...] + "description": { "index": 3, "kind": "parameter", "displayName": "Description", "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": "The description of what the tool does, which the model reads as is to decide when to call the tool, and [...] "destructiveHint": { "index": 4, "kind": "parameter", "displayName": "Destructive 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 may perform destructive or irreversible updates. Advisory for MCP clie [...] "idempotentHint": { "index": 5, "kind": "parameter", "displayName": "Idempotent 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 repeating the tool call with the same arguments has no additional effect. Advisor [...] "openWorldHint": { "index": 6, "kind": "parameter", "displayName": "Open World 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 interacts with external systems outside the application's control. Adviso [...] - "outputParameters": { "index": 7, "kind": "parameter", "displayName": "Output Parameters", "group": "consumer", "label": "consumer", "required": false, "type": "object", "javaType": "java.util.Map<java.lang.String, java.lang.String>", "prefix": "outputParameter.", "multiValue": true, "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.ai.tool.AiToolConfiguration", "configurationField": "configuration", "description": "Tool outpu [...] - "outputSchema": { "index": 8, "kind": "parameter", "displayName": "Output Schema", "group": "consumer", "label": "consumer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "supportFileReference": true, "configurationClass": "org.apache.camel.component.ai.tool.AiToolConfiguration", "configurationField": "configuration", "description": "Raw JSON Schema describing the tool's structured output. Supports inlin [...] - "parameters": { "index": 9, "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, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.ai.tool.AiToolConfiguration", "configurationField": "configuration", "description": "Tool input parameters. Format [...] + "outputParameters": { "index": 7, "kind": "parameter", "displayName": "Output Parameters", "group": "consumer", "label": "consumer", "required": false, "type": "object", "javaType": "java.util.Map<java.lang.String, java.lang.String>", "prefix": "outputParameter.", "multiValue": true, "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.ai.tool.AiToolConfiguration", "configurationField": "configuration", "description": "The fields [...] + "outputSchema": { "index": 8, "kind": "parameter", "displayName": "Output Schema", "group": "consumer", "label": "consumer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "supportFileReference": true, "configurationClass": "org.apache.camel.component.ai.tool.AiToolConfiguration", "configurationField": "configuration", "description": "The JSON Schema of the structured output of the tool, inline or loaded [...] + "parameters": { "index": 9, "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, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.ai.tool.AiToolConfiguration", "configurationField": "configuration", "description": "The input parameters of the t [...] "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 [...] + "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": "Whether the openai producer ends its tool loop with the result of this tool [...] "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 [...] - "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." }, + "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": "A comma-separated list of tags to register the tool under. An AI producer (such as openai, langchain4j-agent or sprin [...] + "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": "The human-readable title of the tool, which MCP clients can show in tools\/list instead of the name. The AI produce [...] "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 [...] "exchangePattern": { "index": 17, "kind": "parameter", "displayName": "Exchange Pattern", "group": "consumer (advanced)", "label": "consumer,advanced", "required": false, "type": "enum", "javaType": "org.apache.camel.ExchangePattern", "enum": [ "InOnly", "InOut" ], "deprecated": false, "autowired": false, "secret": false, "description": "Sets the exchange pattern when the consumer creates an exchange." }, diff --git a/components/camel-ai/camel-ai-tool/src/main/docs/ai-tool-component.adoc b/components/camel-ai/camel-ai-tool/src/main/docs/ai-tool-component.adoc index 3250c86284fe..f4fc3e795d8b 100644 --- a/components/camel-ai/camel-ai-tool/src/main/docs/ai-tool-component.adoc +++ b/components/camel-ai/camel-ai-tool/src/main/docs/ai-tool-component.adoc @@ -2,7 +2,7 @@ :doctitle: AI Tool :shortname: ai-tool :artifactid: camel-ai-tool -:description: Framework-agnostic consumer endpoint that registers a Camel route as an LLM tool in the shared AiToolRegistry. +:description: Expose a Camel route as a tool that a model calls through a Camel AI producer, or that MCP clients call through the Camel MCP server. :since: 4.22 :supportlevel: Preview :tabs-sync-option: diff --git a/components/camel-ai/camel-ai-tool/src/main/java/org/apache/camel/component/ai/tool/AiToolComponent.java b/components/camel-ai/camel-ai-tool/src/main/java/org/apache/camel/component/ai/tool/AiToolComponent.java index c8da477d1e58..55bd40a14a01 100644 --- a/components/camel-ai/camel-ai-tool/src/main/java/org/apache/camel/component/ai/tool/AiToolComponent.java +++ b/components/camel-ai/camel-ai-tool/src/main/java/org/apache/camel/component/ai/tool/AiToolComponent.java @@ -37,7 +37,8 @@ import static org.apache.camel.component.ai.tool.AiTool.SCHEME; @Component(SCHEME) public class AiToolComponent extends DefaultComponent { - @Metadata(description = "The component configuration") + @Metadata(description = "The configuration that every endpoint starts from. The endpoint copies it, and the" + + " options of the endpoint URI replace its values.") private AiToolConfiguration configuration; public AiToolComponent() { 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 ebd668734883..468314df86f7 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 @@ -36,62 +36,67 @@ import org.apache.camel.spi.UriParams; 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 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).") + @UriParam(description = "A comma-separated list of tags to register the tool under. An AI producer (such as openai," + + " langchain4j-agent or spring-ai-chat) offers the model the tools of the tags in its own tags" + + " option, and the MCP server exposes the tools whose tags match its tag patterns. Without" + + " tags, the tool goes into a default pool that is added to every tag a producer selects," + + " and that the MCP server never exposes.") private String tags; @Metadata(label = "consumer") - @UriParam(description = "Human-readable description of what this tool does. " - + "Passed verbatim to the LLM; be precise and action-oriented. " - + "When omitted, defaults to the tool name.") + @UriParam(description = "The description of what the tool does, which the model reads as is to decide when to" + + " call the tool, and which MCP clients see in tools/list. If not set or blank, the tool" + + " name is used.") private String description; @Metadata(label = "consumer") - @UriParam(description = "Tool input parameters. " - + "Format: parameter.NAME=TYPE, parameter.NAME.description=TEXT, " - + "parameter.NAME.required=true or false, parameter.NAME.enum=val1,val2. " - + "Supported types: string, integer, number, boolean. " - + "Mutually exclusive with argSchema.", + @UriParam(description = "The input parameters of the tool, set as parameter.NAME=TYPE," + + " parameter.NAME.description=TEXT, parameter.NAME.required=true or false and" + + " parameter.NAME.enum=VALUE1,VALUE2, from which Camel builds the JSON Schema of the tool" + + " input. TYPE is string, integer, number or boolean, and string when not set or not known." + + " The route receives each argument as a header named NAME, and a call without a required" + + " argument is refused before the route runs. Cannot be combined with argSchema.", prefix = "parameter.", multiValue = true) private Map<String, String> parameters; - @UriParam(description = "Raw JSON Schema for tool input parameters. Supports inline JSON and resource " - + "references (classpath:, file:, resource:). Mutually exclusive with the parameter " - + "multi-value options. Use for nested objects, arrays, oneOf, and other complex schemas. " - + "When the schema does not set additionalProperties, Camel adds additionalProperties: false, " - + "so a client that validates the input (such as the MCP server) refuses an undeclared " - + "argument.") + @UriParam(description = "The JSON Schema of the tool input, inline or loaded from a resource such as" + + " classpath:schema.json or file:schema.json, for input that the parameter options cannot" + + " describe, such as nested objects, arrays and oneOf. The root must be an object schema" + + " with at least one property, and the route receives each top-level argument as a header." + + " When the schema does not set additionalProperties, Camel adds additionalProperties:" + + " false, so a client that validates the input (such as the MCP server) refuses an" + + " undeclared argument. Cannot be combined with the parameter options.") @Metadata(label = "consumer", supportFileReference = true, largeInput = true, inputLanguage = "json") private String argSchema; @Metadata(label = "consumer") - @UriParam(defaultValue = "false", description = "Whether to populate the message body with the tool arguments " - + "as a JSON string, excluding undeclared arguments and reserved names. " - + "Declared argument headers remain available. " - + "When disabled, the message body is left unchanged.") + @UriParam(defaultValue = "false", description = "Whether the route also receives the arguments of the call as a JSON" + + " object in the message body, as a String. The body holds the same" + + " arguments as the headers, so undeclared arguments and names that" + + " start with camel are left out. When false, the route starts" + + " without a body.") private boolean argumentsAsBody; @Metadata(label = "consumer") - @UriParam(description = "Tool output schema fields. " - + "Format: outputParameter.NAME=TYPE, outputParameter.NAME.description=TEXT. " - + "Supported types: string, integer, number, boolean. " - + "Mutually exclusive with outputSchema.", + @UriParam(description = "The fields of the structured output of the tool, set as outputParameter.NAME=TYPE and" + + " outputParameter.NAME.description=TEXT, from which Camel builds the output JSON Schema that" + + " MCP clients see in tools/list. TYPE is string, integer, number or boolean. When set, the" + + " route must reply with a JSON body, which the MCP server returns as structured content." + + " Cannot be combined with outputSchema.", prefix = "outputParameter.", multiValue = true) private Map<String, String> outputParameters; - @UriParam(description = "Raw JSON Schema describing the tool's structured output. Supports inline JSON and " - + "resource references (classpath:, file:, resource:). Mutually exclusive with the " - + "outputParameter multi-value options. When declared, the route body is parsed as JSON " - + "and exposed as structured content to MCP clients.") + @UriParam(description = "The JSON Schema of the structured output of the tool, inline or loaded from a resource" + + " such as classpath:result.json, which MCP clients see in tools/list. When set, the route" + + " must reply with a JSON body, which the MCP server returns as structured content. Cannot" + + " be combined with the outputParameter options.") @Metadata(label = "consumer", supportFileReference = true, largeInput = true, inputLanguage = "json") private String outputSchema; @Metadata(label = "consumer") - @UriParam(description = "Optional display title for MCP tool listings. Advisory hint for MCP clients only.") + @UriParam(description = "The human-readable title of the tool, which MCP clients can show in tools/list instead of" + + " the name. The AI producers do not send it to the model. If not set, the tool has no" + + " title.") private String title; @Metadata(label = "consumer") @@ -115,9 +120,10 @@ public class AiToolConfiguration implements Cloneable { private Boolean openWorldHint; @Metadata(label = "consumer", defaultValue = "false") - @UriParam(description = "When true, AI producers that support agentic tool loops (such as camel-openai) return " - + "this tool's result directly to the caller without sending it back to the model. " - + "Also published as an MCP tool annotation when the tool is exposed via camel-mcp-server.") + @UriParam(description = "Whether the openai producer ends its tool loop with the result of this tool as the reply," + + " without sending the result back to the model. It does so only when every tool that the" + + " model called in that turn sets returnDirect. The other AI producers ignore it, and some" + + " MCP server engines publish it to clients as a tool annotation.") private Boolean returnDirect; @Metadata(label = "consumer", defaultValue = "false") 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 9a559de41130..071839188662 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 @@ -32,8 +32,8 @@ import org.apache.camel.support.DefaultEndpoint; import static org.apache.camel.component.ai.tool.AiTool.SCHEME; /** - * Framework-agnostic consumer endpoint that registers a Camel route as an LLM tool in the shared - * {@link AiToolRegistry}. + * Expose a Camel route as a tool that a model calls through a Camel AI producer, or that MCP clients call through the + * Camel MCP server. * * @since 4.22 */ @@ -59,7 +59,9 @@ import static org.apache.camel.component.ai.tool.AiTool.SCHEME; public class AiToolEndpoint extends DefaultEndpoint { @Metadata(required = true) - @UriPath(description = "The tool name. This is the name the LLM sees and uses to invoke the tool.") + @UriPath(description = "The name of the tool, which the model sees and uses to call it, and which MCP clients see" + + " in tools/list. It must not contain a slash. A route whose tool name is already registered" + + " under one of its tags, or in the pool of tools without tags, fails to start.") private final String toolName; @UriParam(description = "Tool configuration including tags, description, and parameter definitions.") diff --git a/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/ComponentsBuilderFactory.java b/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/ComponentsBuilderFactory.java index 2469679fc916..56b48b7f1394 100644 --- a/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/ComponentsBuilderFactory.java +++ b/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/ComponentsBuilderFactory.java @@ -117,8 +117,8 @@ public interface ComponentsBuilderFactory { } /** * AI Tool (camel-ai-tool) - * Framework-agnostic consumer endpoint that registers a Camel route as an - * LLM tool in the shared AiToolRegistry. + * Expose a Camel route as a tool that a model calls through a Camel AI + * producer, or that MCP clients call through the Camel MCP server. * * Category: ai * Since: 4.22 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 e4dec819e98a..00a73db8fe42 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 @@ -24,8 +24,8 @@ import org.apache.camel.builder.component.ComponentBuilder; import org.apache.camel.component.ai.tool.AiToolComponent; /** - * Framework-agnostic consumer endpoint that registers a Camel route as an LLM - * tool in the shared AiToolRegistry. + * Expose a Camel route as a tool that a model calls through a Camel AI + * producer, or that MCP clients call through the Camel MCP server. * * Generated by camel build tools - do NOT edit this file! */ @@ -34,8 +34,8 @@ public interface AiToolComponentBuilderFactory { /** * AI Tool (camel-ai-tool) - * Framework-agnostic consumer endpoint that registers a Camel route as an - * LLM tool in the shared AiToolRegistry. + * Expose a Camel route as a tool that a model calls through a Camel AI + * producer, or that MCP clients call through the Camel MCP server. * * Category: ai * Since: 4.22 @@ -53,13 +53,15 @@ public interface AiToolComponentBuilderFactory { interface AiToolComponentBuilder extends ComponentBuilder<AiToolComponent> { /** - * Raw JSON Schema for tool input parameters. Supports inline JSON and - * resource references (classpath:, file:, resource:). Mutually - * exclusive with the parameter multi-value options. Use for nested - * objects, arrays, oneOf, and other complex schemas. When the schema - * does not set additionalProperties, Camel adds additionalProperties: - * false, so a client that validates the input (such as the MCP server) - * refuses an undeclared argument. + * The JSON Schema of the tool input, inline or loaded from a resource + * such as classpath:schema.json or file:schema.json, for input that the + * parameter options cannot describe, such as nested objects, arrays and + * oneOf. The root must be an object schema with at least one property, + * and the route receives each top-level argument as a header. When the + * schema does not set additionalProperties, Camel adds + * additionalProperties: false, so a client that validates the input + * (such as the MCP server) refuses an undeclared argument. Cannot be + * combined with the parameter options. * * This option can also be loaded from an existing file, by prefixing * with file: or classpath: followed by the location of the file. @@ -78,10 +80,11 @@ public interface AiToolComponentBuilderFactory { /** - * Whether to populate the message body with the tool arguments as a - * JSON string, excluding undeclared arguments and reserved names. - * Declared argument headers remain available. When disabled, the - * message body is left unchanged. + * Whether the route also receives the arguments of the call as a JSON + * object in the message body, as a String. The body holds the same + * arguments as the headers, so undeclared arguments and names that + * start with camel are left out. When false, the route starts without a + * body. * * The option is a: <code>boolean</code> type. * @@ -125,7 +128,8 @@ public interface AiToolComponentBuilderFactory { } /** - * The component configuration. + * The configuration that every endpoint starts from. The endpoint + * copies it, and the options of the endpoint URI replace its values. * * The option is a: * <code>org.apache.camel.component.ai.tool.AiToolConfiguration</code> type. @@ -141,9 +145,9 @@ public interface AiToolComponentBuilderFactory { } /** - * Human-readable description of what this tool does. Passed verbatim to - * the LLM; be precise and action-oriented. When omitted, defaults to - * the tool name. + * The description of what the tool does, which the model reads as is to + * decide when to call the tool, and which MCP clients see in + * tools/list. If not set or blank, the tool name is used. * * The option is a: <code>java.lang.String</code> type. * @@ -207,10 +211,13 @@ public interface AiToolComponentBuilderFactory { } /** - * Tool output schema fields. Format: outputParameter.NAME=TYPE, - * outputParameter.NAME.description=TEXT. Supported types: string, - * integer, number, boolean. Mutually exclusive with outputSchema. This - * is a multi-value option with prefix: outputParameter. + * The fields of the structured output of the tool, set as + * outputParameter.NAME=TYPE and outputParameter.NAME.description=TEXT, + * from which Camel builds the output JSON Schema that MCP clients see + * in tools/list. TYPE is string, integer, number or boolean. When set, + * the route must reply with a JSON body, which the MCP server returns + * as structured content. Cannot be combined with outputSchema. This is + * a multi-value option with prefix: outputParameter. * * The option is a: <code>java.util.Map&lt;java.lang.String, * java.lang.String&gt;</code> type. @@ -226,11 +233,11 @@ public interface AiToolComponentBuilderFactory { } /** - * Raw JSON Schema describing the tool's structured output. Supports - * inline JSON and resource references (classpath:, file:, resource:). - * Mutually exclusive with the outputParameter multi-value options. When - * declared, the route body is parsed as JSON and exposed as structured - * content to MCP clients. + * The JSON Schema of the structured output of the tool, inline or + * loaded from a resource such as classpath:result.json, which MCP + * clients see in tools/list. When set, the route must reply with a JSON + * body, which the MCP server returns as structured content. Cannot be + * combined with the outputParameter options. * * This option can also be loaded from an existing file, by prefixing * with file: or classpath: followed by the location of the file. @@ -248,11 +255,14 @@ public interface AiToolComponentBuilderFactory { } /** - * Tool input parameters. Format: parameter.NAME=TYPE, + * The input parameters of the tool, set as parameter.NAME=TYPE, * parameter.NAME.description=TEXT, parameter.NAME.required=true or - * false, parameter.NAME.enum=val1,val2. Supported types: string, - * integer, number, boolean. Mutually exclusive with argSchema. This is - * a multi-value option with prefix: parameter. + * false and parameter.NAME.enum=VALUE1,VALUE2, from which Camel builds + * the JSON Schema of the tool input. TYPE is string, integer, number or + * boolean, and string when not set or not known. The route receives + * each argument as a header named NAME, and a call without a required + * argument is refused before the route runs. Cannot be combined with + * argSchema. This is a multi-value option with prefix: parameter. * * The option is a: <code>java.util.Map&lt;java.lang.String, * java.lang.String&gt;</code> type. @@ -285,10 +295,11 @@ public interface AiToolComponentBuilderFactory { /** - * When true, AI producers that support agentic tool loops (such as - * camel-openai) return this tool's result directly to the caller - * without sending it back to the model. Also published as an MCP tool - * annotation when the tool is exposed via camel-mcp-server. + * Whether the openai producer ends its tool loop with the result of + * this tool as the reply, without sending the result back to the model. + * It does so only when every tool that the model called in that turn + * sets returnDirect. The other AI producers ignore it, and some MCP + * server engines publish it to clients as a tool annotation. * * The option is a: <code>java.lang.Boolean</code> type. * @@ -325,12 +336,12 @@ 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 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). + * A comma-separated list of tags to register the tool under. An AI + * producer (such as openai, langchain4j-agent or spring-ai-chat) offers + * the model the tools of the tags in its own tags option, and the MCP + * server exposes the tools whose tags match its tag patterns. Without + * tags, the tool goes into a default pool that is added to every tag a + * producer selects, and that the MCP server never exposes. * * The option is a: <code>java.lang.String</code> type. * @@ -345,8 +356,9 @@ public interface AiToolComponentBuilderFactory { } /** - * Optional display title for MCP tool listings. Advisory hint for MCP - * clients only. + * The human-readable title of the tool, which MCP clients can show in + * tools/list instead of the name. The AI producers do not send it to + * the model. If not set, the tool has no title. * * The option is a: <code>java.lang.String</code> type. * diff --git a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/EndpointHeaderBuilders.java b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/EndpointHeaderBuilders.java index 68ed0093ca3c..55923586a179 100644 --- a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/EndpointHeaderBuilders.java +++ b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/EndpointHeaderBuilders.java @@ -96,8 +96,8 @@ public class EndpointHeaderBuilders { } /** * AI Tool (camel-ai-tool) - * Framework-agnostic consumer endpoint that registers a Camel route as an - * LLM tool in the shared AiToolRegistry. + * Expose a Camel route as a tool that a model calls through a Camel AI + * producer, or that MCP clients call through the Camel MCP server. * * Category: ai * Since: 4.22 diff --git a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/StaticEndpointBuilders.java b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/StaticEndpointBuilders.java index af2f504ddcdf..48a21c38b51f 100644 --- a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/StaticEndpointBuilders.java +++ b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/StaticEndpointBuilders.java @@ -284,8 +284,8 @@ public class StaticEndpointBuilders { } /** * AI Tool (camel-ai-tool) - * Framework-agnostic consumer endpoint that registers a Camel route as an - * LLM tool in the shared AiToolRegistry. + * Expose a Camel route as a tool that a model calls through a Camel AI + * producer, or that MCP clients call through the Camel MCP server. * * Category: ai * Since: 4.22 @@ -294,7 +294,10 @@ public class StaticEndpointBuilders { * Syntax: <code>ai-tool:toolName</code> * * Path parameter: toolName (required) - * The tool name. This is the name the LLM sees and uses to invoke the tool. + * The name of the tool, which the model sees and uses to call it, and which + * MCP clients see in tools/list. It must not contain a slash. A route whose + * tool name is already registered under one of its tags, or in the pool of + * tools without tags, fails to start. * * @param path toolName * @return the dsl builder @@ -304,8 +307,8 @@ public class StaticEndpointBuilders { } /** * AI Tool (camel-ai-tool) - * Framework-agnostic consumer endpoint that registers a Camel route as an - * LLM tool in the shared AiToolRegistry. + * Expose a Camel route as a tool that a model calls through a Camel AI + * producer, or that MCP clients call through the Camel MCP server. * * Category: ai * Since: 4.22 @@ -314,7 +317,10 @@ public class StaticEndpointBuilders { * Syntax: <code>ai-tool:toolName</code> * * Path parameter: toolName (required) - * The tool name. This is the name the LLM sees and uses to invoke the tool. + * The name of the tool, which the model sees and uses to call it, and which + * MCP clients see in tools/list. It must not contain a slash. A route whose + * tool name is already registered under one of its tags, or in the pool of + * tools without tags, fails to start. * * @param componentName to use a custom component name for the endpoint * instead of the default name 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 38b11d4a1238..98a146a8b8a7 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 @@ -27,8 +27,8 @@ import org.apache.camel.builder.EndpointProducerBuilder; import org.apache.camel.builder.endpoint.AbstractEndpointBuilder; /** - * Framework-agnostic consumer endpoint that registers a Camel route as an LLM - * tool in the shared AiToolRegistry. + * Expose a Camel route as a tool that a model calls through a Camel AI + * producer, or that MCP clients call through the Camel MCP server. * * Generated by camel build tools - do NOT edit this file! */ @@ -46,13 +46,15 @@ public interface AiToolEndpointBuilderFactory { } /** - * Raw JSON Schema for tool input parameters. Supports inline JSON and - * resource references (classpath:, file:, resource:). Mutually - * exclusive with the parameter multi-value options. Use for nested - * objects, arrays, oneOf, and other complex schemas. When the schema - * does not set additionalProperties, Camel adds additionalProperties: - * false, so a client that validates the input (such as the MCP server) - * refuses an undeclared argument. + * The JSON Schema of the tool input, inline or loaded from a resource + * such as classpath:schema.json or file:schema.json, for input that the + * parameter options cannot describe, such as nested objects, arrays and + * oneOf. The root must be an object schema with at least one property, + * and the route receives each top-level argument as a header. When the + * schema does not set additionalProperties, Camel adds + * additionalProperties: false, so a client that validates the input + * (such as the MCP server) refuses an undeclared argument. Cannot be + * combined with the parameter options. * * This option can also be loaded from an existing file, by prefixing * with file: or classpath: followed by the location of the file. @@ -69,10 +71,11 @@ public interface AiToolEndpointBuilderFactory { return this; } /** - * Whether to populate the message body with the tool arguments as a - * JSON string, excluding undeclared arguments and reserved names. - * Declared argument headers remain available. When disabled, the - * message body is left unchanged. + * Whether the route also receives the arguments of the call as a JSON + * object in the message body, as a String. The body holds the same + * arguments as the headers, so undeclared arguments and names that + * start with camel are left out. When false, the route starts without a + * body. * * The option is a: <code>boolean</code> type. * @@ -87,10 +90,11 @@ public interface AiToolEndpointBuilderFactory { return this; } /** - * Whether to populate the message body with the tool arguments as a - * JSON string, excluding undeclared arguments and reserved names. - * Declared argument headers remain available. When disabled, the - * message body is left unchanged. + * Whether the route also receives the arguments of the call as a JSON + * object in the message body, as a String. The body holds the same + * arguments as the headers, so undeclared arguments and names that + * start with camel are left out. When false, the route starts without a + * body. * * The option will be converted to a <code>boolean</code> type. * @@ -105,9 +109,9 @@ public interface AiToolEndpointBuilderFactory { return this; } /** - * Human-readable description of what this tool does. Passed verbatim to - * the LLM; be precise and action-oriented. When omitted, defaults to - * the tool name. + * The description of what the tool does, which the model reads as is to + * decide when to call the tool, and which MCP clients see in + * tools/list. If not set or blank, the tool name is used. * * The option is a: <code>java.lang.String</code> type. * @@ -216,10 +220,13 @@ public interface AiToolEndpointBuilderFactory { return this; } /** - * Tool output schema fields. Format: outputParameter.NAME=TYPE, - * outputParameter.NAME.description=TEXT. Supported types: string, - * integer, number, boolean. Mutually exclusive with outputSchema. This - * is a multi-value option with prefix: outputParameter. + * The fields of the structured output of the tool, set as + * outputParameter.NAME=TYPE and outputParameter.NAME.description=TEXT, + * from which Camel builds the output JSON Schema that MCP clients see + * in tools/list. TYPE is string, integer, number or boolean. When set, + * the route must reply with a JSON body, which the MCP server returns + * as structured content. Cannot be combined with outputSchema. This is + * a multi-value option with prefix: outputParameter. * * The option is a: <code>java.util.Map<java.lang.String, * java.lang.String></code> type. @@ -238,10 +245,13 @@ public interface AiToolEndpointBuilderFactory { return this; } /** - * Tool output schema fields. Format: outputParameter.NAME=TYPE, - * outputParameter.NAME.description=TEXT. Supported types: string, - * integer, number, boolean. Mutually exclusive with outputSchema. This - * is a multi-value option with prefix: outputParameter. + * The fields of the structured output of the tool, set as + * outputParameter.NAME=TYPE and outputParameter.NAME.description=TEXT, + * from which Camel builds the output JSON Schema that MCP clients see + * in tools/list. TYPE is string, integer, number or boolean. When set, + * the route must reply with a JSON body, which the MCP server returns + * as structured content. Cannot be combined with outputSchema. This is + * a multi-value option with prefix: outputParameter. * * The option is a: <code>java.util.Map<java.lang.String, * java.lang.String></code> type. @@ -259,11 +269,11 @@ public interface AiToolEndpointBuilderFactory { return this; } /** - * Raw JSON Schema describing the tool's structured output. Supports - * inline JSON and resource references (classpath:, file:, resource:). - * Mutually exclusive with the outputParameter multi-value options. When - * declared, the route body is parsed as JSON and exposed as structured - * content to MCP clients. + * The JSON Schema of the structured output of the tool, inline or + * loaded from a resource such as classpath:result.json, which MCP + * clients see in tools/list. When set, the route must reply with a JSON + * body, which the MCP server returns as structured content. Cannot be + * combined with the outputParameter options. * * This option can also be loaded from an existing file, by prefixing * with file: or classpath: followed by the location of the file. @@ -280,11 +290,14 @@ public interface AiToolEndpointBuilderFactory { return this; } /** - * Tool input parameters. Format: parameter.NAME=TYPE, + * The input parameters of the tool, set as parameter.NAME=TYPE, * parameter.NAME.description=TEXT, parameter.NAME.required=true or - * false, parameter.NAME.enum=val1,val2. Supported types: string, - * integer, number, boolean. Mutually exclusive with argSchema. This is - * a multi-value option with prefix: parameter. + * false and parameter.NAME.enum=VALUE1,VALUE2, from which Camel builds + * the JSON Schema of the tool input. TYPE is string, integer, number or + * boolean, and string when not set or not known. The route receives + * each argument as a header named NAME, and a call without a required + * argument is refused before the route runs. Cannot be combined with + * argSchema. This is a multi-value option with prefix: parameter. * * The option is a: <code>java.util.Map<java.lang.String, * java.lang.String></code> type. @@ -303,11 +316,14 @@ public interface AiToolEndpointBuilderFactory { return this; } /** - * Tool input parameters. Format: parameter.NAME=TYPE, + * The input parameters of the tool, set as parameter.NAME=TYPE, * parameter.NAME.description=TEXT, parameter.NAME.required=true or - * false, parameter.NAME.enum=val1,val2. Supported types: string, - * integer, number, boolean. Mutually exclusive with argSchema. This is - * a multi-value option with prefix: parameter. + * false and parameter.NAME.enum=VALUE1,VALUE2, from which Camel builds + * the JSON Schema of the tool input. TYPE is string, integer, number or + * boolean, and string when not set or not known. The route receives + * each argument as a header named NAME, and a call without a required + * argument is refused before the route runs. Cannot be combined with + * argSchema. This is a multi-value option with prefix: parameter. * * The option is a: <code>java.util.Map<java.lang.String, * java.lang.String></code> type. @@ -356,10 +372,11 @@ public interface AiToolEndpointBuilderFactory { return this; } /** - * When true, AI producers that support agentic tool loops (such as - * camel-openai) return this tool's result directly to the caller - * without sending it back to the model. Also published as an MCP tool - * annotation when the tool is exposed via camel-mcp-server. + * Whether the openai producer ends its tool loop with the result of + * this tool as the reply, without sending the result back to the model. + * It does so only when every tool that the model called in that turn + * sets returnDirect. The other AI producers ignore it, and some MCP + * server engines publish it to clients as a tool annotation. * * The option is a: <code>java.lang.Boolean</code> type. * @@ -374,10 +391,11 @@ public interface AiToolEndpointBuilderFactory { return this; } /** - * When true, AI producers that support agentic tool loops (such as - * camel-openai) return this tool's result directly to the caller - * without sending it back to the model. Also published as an MCP tool - * annotation when the tool is exposed via camel-mcp-server. + * Whether the openai producer ends its tool loop with the result of + * this tool as the reply, without sending the result back to the model. + * It does so only when every tool that the model called in that turn + * sets returnDirect. The other AI producers ignore it, and some MCP + * server engines publish it to clients as a tool annotation. * * The option will be converted to a <code>java.lang.Boolean</code> * type. @@ -431,12 +449,12 @@ public interface AiToolEndpointBuilderFactory { return this; } /** - * 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 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). + * A comma-separated list of tags to register the tool under. An AI + * producer (such as openai, langchain4j-agent or spring-ai-chat) offers + * the model the tools of the tags in its own tags option, and the MCP + * server exposes the tools whose tags match its tag patterns. Without + * tags, the tool goes into a default pool that is added to every tag a + * producer selects, and that the MCP server never exposes. * * The option is a: <code>java.lang.String</code> type. * @@ -450,8 +468,9 @@ public interface AiToolEndpointBuilderFactory { return this; } /** - * Optional display title for MCP tool listings. Advisory hint for MCP - * clients only. + * The human-readable title of the tool, which MCP clients can show in + * tools/list instead of the name. The AI producers do not send it to + * the model. If not set, the tool has no title. * * The option is a: <code>java.lang.String</code> type. * @@ -701,8 +720,8 @@ public interface AiToolEndpointBuilderFactory { public interface AiToolBuilders { /** * AI Tool (camel-ai-tool) - * Framework-agnostic consumer endpoint that registers a Camel route as - * an LLM tool in the shared AiToolRegistry. + * Expose a Camel route as a tool that a model calls through a Camel AI + * producer, or that MCP clients call through the Camel MCP server. * * Category: ai * Since: 4.22 @@ -715,8 +734,8 @@ public interface AiToolEndpointBuilderFactory { } /** * AI Tool (camel-ai-tool) - * Framework-agnostic consumer endpoint that registers a Camel route as - * an LLM tool in the shared AiToolRegistry. + * Expose a Camel route as a tool that a model calls through a Camel AI + * producer, or that MCP clients call through the Camel MCP server. * * Category: ai * Since: 4.22 @@ -725,8 +744,10 @@ public interface AiToolEndpointBuilderFactory { * Syntax: <code>ai-tool:toolName</code> * * Path parameter: toolName (required) - * The tool name. This is the name the LLM sees and uses to invoke the - * tool. + * The name of the tool, which the model sees and uses to call it, and + * which MCP clients see in tools/list. It must not contain a slash. A + * route whose tool name is already registered under one of its tags, or + * in the pool of tools without tags, fails to start. * * @param path toolName * @return the dsl builder @@ -736,8 +757,8 @@ public interface AiToolEndpointBuilderFactory { } /** * AI Tool (camel-ai-tool) - * Framework-agnostic consumer endpoint that registers a Camel route as - * an LLM tool in the shared AiToolRegistry. + * Expose a Camel route as a tool that a model calls through a Camel AI + * producer, or that MCP clients call through the Camel MCP server. * * Category: ai * Since: 4.22 @@ -746,8 +767,10 @@ public interface AiToolEndpointBuilderFactory { * Syntax: <code>ai-tool:toolName</code> * * Path parameter: toolName (required) - * The tool name. This is the name the LLM sees and uses to invoke the - * tool. + * The name of the tool, which the model sees and uses to call it, and + * which MCP clients see in tools/list. It must not contain a slash. A + * route whose tool name is already registered under one of its tags, or + * in the pool of tools without tags, fails to start. * * @param componentName to use a custom component name for the endpoint * instead of the default name diff --git a/tasks/component-descriptions.md b/tasks/component-descriptions.md index 92a33c2e6d95..ca179f755376 100644 --- a/tasks/component-descriptions.md +++ b/tasks/component-descriptions.md @@ -57,7 +57,7 @@ or removes its row. | camel-activemq6 | activemq6 | | | camel-ai-prompt | ai-prompt | yes | | camel-ai-resource | ai-resource | | -| camel-ai-tool | ai-tool | | +| camel-ai-tool | ai-tool | yes | | camel-alibaba-eventbridge | alibaba-eventbridge | yes | | camel-alibaba-fc | alibaba-fc | yes | | camel-alibaba-kms | alibaba-kms | yes |
