Then how does control flow is executed ? You can prompt, check for something, then if condition then do something, or loop to do until something. How can the agent knows to interpret ?
You send a request, the tool call executes and returns a response to the calling model or client, then you handle it somehow. You can add the output of the tool call into the context and prompt the model again...or just return the output of the tool execution. There are many ways to do it.