How LLMs Call Tools
How LLMs use function calling and tool use — the mechanics behind tool-calling agents, from prompt engineering to structured output.
Last updated
How LLMs Actually Call Tools
LLMs never execute code — they emit structured text that your system runs. Master this one mechanism and every agent, from a support bot to a coding assistant, stops being magic and starts being architecture.
Tool calling is an illusion of action. The model outputs a JSON object that looks like a function call. Your code parses it, runs the real function, and feeds the result back as more text. The model never touches your APIs, databases, or file system — it only ever reads and writes tokens.