# A tool that throws (ORD-500 raises IllegalStateException: order database unavailable)

Case 1: a well-behaved model. It asks for the tool once, then answers from whatever the tool message says.
  Spring AI    : 2 requests, tool body ran 1 time(s). Tool message the model received: "order database unavailable"
                 answer: Done: order database unavailable
  LangChain4j  : 2 requests, tool body ran 1 time(s). Tool message the model received: "order database unavailable"
                 answer: Done: order database unavailable

Case 2: an insistent model. It asks for the tool again after every result. The server stops it with an HTTP 500 after 30 requests.
  Spring AI    : 31 requests, tool body ran 30 time(s)
                 exception InternalServerException: 500: cutoff reached
  LangChain4j  : 31 requests, tool body ran 30 time(s)
                 exception InternalServerException (root: HttpException): {"error":{"message":"cutoff reached"}}

Case 3: the same insistent model, each framework asked to stop after 5 tool rounds.
  Spring AI    (ToolCallingAdvisor + our MaxToolRounds(5) checker): 6 requests, tool body ran 5 time(s)
                 answer: 
  LangChain4j  (maxSequentialToolsInvocations(5))                  : 6 requests, tool body ran 5 time(s)
                 exception RuntimeException: Something is wrong, exceeded 5 tool calling round trips (maxToolCallingRoundTrips)
