How does it work?
You describe the functions available — name, purpose, and the shape of their arguments. When a request would be better served by one of them, the model replies with a structured call rather than prose: the function name and the arguments filled in. Your code validates it, runs it if appropriate, and passes the return value back as a new message. Selection accuracy holds up well across a handful of clearly distinct tools and starts degrading noticeably somewhere past twenty, which is the point to split the work across specialised agents instead.
The model then continues with the real result in its context. Asked for the weather, it does not invent a temperature; it asks for the weather function to be called, then reports what came back.
