jargon

Applied AI·Structured outputs and tool calling

a while loop around an HTTP call, with a switch statement over tool names in the middle.

The tool loop

The full cycle in code: send messages plus tool definitions, receive a tool call, execute it, append the result, call the API again, and repeat until the model produces a plain answer. Script 5 is this loop written by hand; every agent framework is this loop with decoration.

Commonly confused with