Decorator — add cross-cutting concerns
public class CachedTool implements Tool {
private final Tool inner;
private final Cache cache;
public Object call(Map args) {
return cache.get(cacheKey(args), k -> inner.call(args));
}
} Advertisement
Aggregator — combine multiple
One tool that fans out to N sub-tools, merges results. Hides complexity from the model.
Advertisement
Adapter — reshape args/results
Wraps an existing tool with a friendlier schema. Useful when the model struggles with the raw interface.