Package dyntabs.ai.annotation
Annotation Interface EasyTool
Optional annotation that adds a description to a tool method.
Important: This annotation is NOT required. EasyAI automatically discovers
all public methods on objects passed to withTools(). This annotation simply
provides a better description that helps the AI understand what the method does.
Without @EasyTool (works fine)
public class OrderService {
// AI sees this as: tool name="findOrder", description="findOrder"
public String findOrder(String orderId) {
return orderRepo.findById(orderId).toString();
}
}
With @EasyTool (better AI understanding)
public class OrderService {
// AI sees this as: tool name="findOrder",
// description="Finds an order by its ID and returns order details"
@EasyTool("Finds an order by its ID and returns order details")
public String findOrder(String orderId) {
return orderRepo.findById(orderId).toString();
}
}
When to Use @EasyTool
- When the method name alone is not descriptive enough
- When the AI keeps picking the wrong method
- When you have multiple similar methods and the AI needs to distinguish them
- See Also:
-
Required Element Summary
Required Elements
-
Element Details
-
value
String valueA human-readable description of what the tool method does. This description is sent to the AI model to help it decide when to call this method.Good descriptions explain what the method does and when to use it:
- "Finds an order by its ID and returns order details including status and items"
- "Cancels an active order. Only works for orders that have not been shipped yet."
- "Returns the current weather for a given city name"
- Returns:
- the tool description
-