General agent concepts
Tool calling
Tool calling is how a language model acts outside its own text. The model is given a set of tool definitions, each with a name, a description, and an argument schema. When it decides a tool is needed, it emits a structured call naming the tool and its arguments, the runtime executes the call, and the result goes back into the model's context. The model can then answer or chain further calls, and an agent is essentially this loop run until the task is done. Three model-side steps sit inside it: choosing the tool, forming the arguments, and interpreting what comes back.
It exists because a model on its own can only generate text from what's already in its context. Tools let it fetch data that changes, like a database row, a search result, or a calendar, run computation it can't do reliably in its head, and take real actions like sending a message, editing a file, or calling an API.
An agent reaches for a tool when the task needs something outside the model's context or beyond text generation: current state it can't know, an action with side effects, or an answer that has to be exact where a plausible guess isn't enough. The tool definitions the agent carries set what it can do. Which tool the model picks, and the arguments it forms, decide what it actually does.
7 questions