Hide multi-step behind one interface

public class SyncToStoreTool implements Tool {
  public Object call(Map args) {
    var fresh = fetchTool.call(args);
    var normalized = normalize(fresh);
    storeTool.call(Map.of("data", normalized));
    return Map.of("stored", true, "count", normalized.size());
  }
}
Advertisement

Why hide it

Model doesn't need to know about the internal steps. Less prompt clutter, fewer choices for the model to fumble.

Advertisement

Failure semantics

Partial success is ambiguous. Design so the tool commits atomically or returns a compensation-required error.