Matryoshka Tool
Deprecated
Use UnfoldingTool instead
Replace with
import com.embabel.agent.api.tool.progressive.UnfoldingTool
UnfoldingToolA tool that contains other tools, enabling progressive tool disclosure.
Named after Russian nesting dolls, a MatryoshkaTool presents a high-level description to the LLM. When invoked, its inner tools become available and (optionally) the MatryoshkaTool itself is removed.
See also
Types
Companion object that extends UnfoldingTool.Factory to provide factory methods. All factory methods from UnfoldingTool are available.
Properties
Detail that is progressively disclosed: hidden until the LLM invokes this tool, then appended verbatim to the unfolded message returned by call (after the "Tools now available: …" preamble).
Tool definition for LLM
When true, expanding this tool removes ALL other tools from the LLM's tool set — the LLM will only see the inner tools until the interaction ends. Use this for tools where the LLM consistently picks the wrong sibling tool instead of using the inner tools (e.g., personality changes).
The inner tools that will be exposed when this tool is invoked. This is a fixed set that does not vary by context.
Optional metadata
Whether to remove this tool after invocation.
Functions
Execute the tool with JSON input.
Execute the tool with JSON input and out-of-band context.
Returns the fixed innerTools regardless of process context.
Select which inner tools to expose based on invocation input.
Extension function to convert an Embabel Tool to a Spring AI ToolCallback.
Wrap this tool to conditionally await before execution.
Wrap this tool to always require confirmation before execution.
Create a new tool with additional definition metadata entries merged in. Existing keys are overwritten by the new values.
Create a new tool with a single definition metadata entry added.
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 new UnfoldingTool with tools added from an annotated object.
Create a new UnfoldingTool with additional tools added.