Simple Agentic Tool
A simple agentic tool where all sub-tools are available immediately.
This is the most basic form of AgenticTool - all tools are available to the LLM from the start with no conditions or state requirements.
For more controlled tool availability, see:
com.embabel.agent.api.tool.agentic.playbook.PlaybookTool: Progressive unlock via conditions
com.embabel.agent.api.tool.agentic.state.StateMachineTool: State-based availability
Parameters
Tool definition (name, description, input schema)
Optional tool metadata
LLM to use for orchestration
Sub-tools available for the LLM to orchestrate
Create prompt for the LLM to use, given context and input
Maximum number of tool loop iterations
Whether to capture artifacts from nested AgenticTools
Constructors
Create a simple agentic tool with name and description.
Properties
Functions
Execute the tool with JSON input.
Extension function to convert an Embabel Tool to a Spring AI ToolCallback.
Wrap this tool to conditionally await before execution.
Create a copy with different captureNestedArtifacts setting.
Wrap this tool to always require confirmation before execution.
Create a new tool with a different description. Useful for providing context-specific descriptions while keeping the same functionality.
Extension function to wrap a Tool with event publication.
Create a copy with different LLM options.
Create a copy with a different max iterations limit.
Create a copy with an additional parameter in the definition.
Create a copy with a fixed system prompt. This is a convenience method that delegates to withSystemPrompt with a creator.
Create a copy with a dynamic system prompt creator. The creator receives the execution context and input string.
Register a class whose @LlmTool methods become available as tools when a single instance of that type is returned as an artifact.
Register a class that can contribute @LlmTool methods when a single instance is retrieved. Kotlin-friendly version using reified type parameter.
Register a domain class with a predicate. Kotlin-friendly version using reified type parameter.
Register a domain class with a predicate to control when its @LlmTool methods become available as tools.
Enable auto-discovery of chained tools from any returned artifact.
Create a copy with tools extracted from an object with @LlmTool methods. If the object has no @LlmTool methods, returns this unchanged.
Create a copy with tools extracted from multiple objects with @LlmTool methods.
Create a copy with additional tools.