Current Spring AI's tool calling mechanism allows Large Language Models (LLMs) to suggest and execute methods annotated with @Tool. It is powerful, it lacks a built-in, declarative way to signify that a particular tool's execution by enabling a clear "human-in-the-loop" mechanism for tool execution.
@Tool(description = "Deletes the given book by id")
@RequiresConsent(message = "The book {bookId} is going to be deleted. Do you approve?")
public void deleteBookById(String bookId) {
// Actual logic to delete a book
}