Camel Spring Boot

AI Tool

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.

What’s inside

Please refer to the above links for usage and configuration details.

Maven coordinates

<dependency>
    <groupId>org.apache.camel.springboot</groupId>
    <artifactId>camel-ai-tool-starter</artifactId>
</dependency>

Spring Boot Auto-Configuration

The starter supports 21 options, which are listed below.

Name Description Default Type

camel.component.ai-tool.all-roles-required

Whether the caller needs all the roles in allowedRoles, rather than any one of them. Has no effect when allowedRoles is not set.

false

Boolean

camel.component.ai-tool.allowed-roles

Comma-separated list of the roles a caller needs to call the tool, for example finance,controlling. Any one of them is enough unless allRolesRequired is set. The roles are checked before the route runs, against the caller’s roles in the exchange property CamelAiToolSecurityPrincipalRoles: a call without that property is refused. A value that is set but names no role refuses every call. Set it on the component as the default of every tool route, or per endpoint to replace it.

String

camel.component.ai-tool.arg-schema

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.

String

camel.component.ai-tool.arguments-as-body

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.

false

Boolean

camel.component.ai-tool.authorization-policy

Reference to an org.apache.camel.spi.AuthorizationPolicy used to authorize tool calls before the route runs. Set it on the component to guard every tool route by construction, or per endpoint to override. The policy authorizes on trustworthy input only: the tool name comes from the route (never from model output), and the caller identity is carried as an exchange property set before the agent ran (for example by camel-spiffe or camel-keycloak), which the model cannot set. Authorize on exchange properties or validated tokens only, never on message headers (on a tool route the headers carry the model-controlled tool arguments). A denied call surfaces to the model as a short refusal rather than a stack trace. The option is a org.apache.camel.spi.AuthorizationPolicy type.

AuthorizationPolicy

camel.component.ai-tool.autowired-enabled

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 type, which then gets configured on the component. This can be used for automatic configuring JDBC data sources, JMS connection factories, AWS Clients, etc.

true

Boolean

camel.component.ai-tool.bridge-error-handler

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 likes, will now be processed as a message and handled by the routing Error Handler. Important: This is only possible if the 3rd party component allows Camel to be alerted if an exception was thrown. Some components handle this internally only, and therefore bridgeErrorHandler is not possible. In other situations we may improve the Camel component to hook into the 3rd party component and make this possible for future releases. By default the consumer will use the org.apache.camel.spi.ExceptionHandler to deal with exceptions, that will be logged at WARN or ERROR level and ignored.

false

Boolean

camel.component.ai-tool.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 org.apache.camel.component.ai.tool.AiToolConfiguration type.

AiToolConfiguration

camel.component.ai-tool.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.

String

camel.component.ai-tool.destructive-hint

MCP hint that the tool may perform destructive or irreversible updates. Advisory for MCP clients; not enforced by Camel.

Boolean

camel.component.ai-tool.enabled

Whether to enable auto configuration of the ai-tool component. This is enabled by default.

Boolean

camel.component.ai-tool.idempotent-hint

MCP hint that repeating the tool call with the same arguments has no additional effect. Advisory for MCP clients; not enforced by Camel.

Boolean

camel.component.ai-tool.open-world-hint

MCP hint that the tool interacts with external systems outside the application’s control. Advisory for MCP clients; not enforced by Camel.

Boolean

camel.component.ai-tool.output-parameters

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.

String>

camel.component.ai-tool.output-schema

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.

String

camel.component.ai-tool.parameters

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. This is a multi-value option with prefix: parameter.

String>

camel.component.ai-tool.read-only-hint

MCP hint that the tool only reads data and does not modify state. Advisory for MCP clients; not enforced by Camel.

Boolean

camel.component.ai-tool.return-direct

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.

false

Boolean

camel.component.ai-tool.searchable

When true, this route tool is eligible for tool search and is omitted from the initial model request while the producer has tool search enabled. When false, the tool stays directly visible to the model. Searchability is a visibility policy, not an authorization policy, and has no effect when tool search is disabled.

false

Boolean

camel.component.ai-tool.tags

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.

String

camel.component.ai-tool.title

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.

String