← Back to Glossary

Tool Calling

When an LLM emits structured calls to external tools (search, code, APIs) and then continues generation after the tool results return.

How it works

LLMs are fine-tuned to recognise when a user query requires external information or computation, and to emit structured JSON function call outputs describing the tool name and arguments. A calling framework intercepts this output, executes the corresponding tool (running a web search, a database query, a code interpreter, or an API call), and injects the results back into the model's context as a tool result message. The model then resumes generation, incorporating the tool output into its response.

Why it matters

Tool calling extends LLMs beyond their training data and static capabilities. It enables real-time information retrieval, deterministic computation (avoiding arithmetic errors), database access, and interaction with external systems — transforming LLMs from static knowledge stores into dynamic agents. The combination of tool calling with long context is what makes modern AI agents useful for complex real-world tasks. Tool calling support is now a baseline requirement for any production-grade LLM API.

Let's talk

Have something worth building?

Newsletter

Stay in the loop

AI tools, tips & tricks — no spam.

Type to start searching...