Server-side reply discipline (ignored when
serverSide=false).
false (default) — synchronous: confiqure waits on the HTTP call and
takes the method's return value as the tool result. Your handler is plain Spring — the
request body IS your DTO (no envelope), and confiqureKey is injected into it:
@Confiqure.Tool(name = "lookup_supplier")
@PostMapping("/supplier")
public SupplierDto lookup(@RequestBody SupplierQuery q) { return service.lookup(q); }
true — asynchronous: confiqure ACKs immediately and you deliver the
result later. The ai.confiqure:confiqure-spring SDK injects a
ConfiqureCallback that does the header-reading + signed POST for you (the same
confiqureKey rides your @RequestBody DTO as in the sync case):
@Confiqure.Tool(name = "analyze_supplier", async = true)
@PostMapping("/analyze")
public ResponseEntity<Void> analyze(@RequestBody SupplierQuery q, ConfiqureCallback reply) {
CompletableFuture.supplyAsync(() -> service.slowAnalysis(q))
.whenComplete((r, ex) -> { if (ex != null) reply.fail(ex.getMessage()); else reply.reply(r); });
return ResponseEntity.accepted().build(); // ACK now; the result follows
}
Without the SDK, read the
X-Confiqure-Tool-Call-Id +
X-Confiqure-Reply-Url
headers and POST
{"result":…} back yourself. Use async only when the work outlives
one request (long jobs, human-in-the-loop, webhooks); ~90% of tools are synchronous, and
even a slow sync handler has a 5-minute window before async is warranted.