Package com.embabel.agent.api.annotation
Annotation UnfoldingTools
-
- All Implemented Interfaces:
@Target(allowedTargets = {AnnotationTarget.CLASS}) public @interface UnfoldingTools
Marks a class as an UnfoldingTool container for progressive tool disclosure.
When applied to a class containing
@LlmToolmethods, creates a facade tool that exposes those methods when invoked. This enables progressive tool disclosure, reducing the initial tool set complexity for the LLM.Example - Simple facade:
@UnfoldingTools( name = "database_operations", description = "Database operations. Invoke to see specific tools." ) public class DatabaseTools { @LlmTool(description = "Execute a SQL query") public QueryResult query(String sql) { ... } @LlmTool(description = "Insert a record") public InsertResult insert(String table, Map<String, Object> data) { ... } } // Create the UnfoldingTool UnfoldingTool tool = UnfoldingTool.fromInstance(new DatabaseTools());Example - Category-based selection:
@UnfoldingTools( name = "file_operations", description = "File operations. Pass category to select tools." ) public class FileTools { @LlmTool(description = "Read file contents", category = "read") public String readFile(String path) { ... } @LlmTool(description = "List directory", category = "read") public List<String> listDir(String path) { ... } @LlmTool(description = "Write file", category = "write") public void writeFile(String path, String content) { ... } @LlmTool(description = "Delete file", category = "write") public void deleteFile(String path) { ... } } // Creates a category-based UnfoldingTool automatically UnfoldingTool tool = UnfoldingTool.fromInstance(new FileTools());
-
-
Field Summary
Fields Modifier and Type Field Description private final Stringnameprivate final Stringdescriptionprivate final BooleanremoveOnInvokeprivate final StringcategoryParameterprivate final StringchildToolUsageNotes
-