Agents & Tools
Tool Use Mechanics
9 min+90 XPStep 1/11
The model never calls anything — you do
Despite the name, 'function calling' means the model emits text — a structured tool_call object with a function name and JSON arguments. Your code parses it, executes the real function, and appends the result back into the context as a tool message. Then the model continues.
The model's only power is writing the request. Every security boundary, timeout, and permission check lives in your harness.
insight
The most misunderstood part of agents: the LLM proposes, the runtime disposes. Never confuse the two.