Function Calling

Function calling, sometimes called tool calling, is the mechanism by which a language model connects to external systems. The developer describes a set of functions to the model, usually as a JSON schema giving each function’s name, purpose, and parameters. When the model receives a prompt, it decides whether any of those functions would help, and if so it returns a structured object naming the function and the arguments to pass, rather than answering in free-form prose. The developer’s code then actually runs the function and feeds the result back to the model so it can finish its response.

The pattern matters because language models on their own cannot check today’s weather, query a database, send an email, or run a calculation reliably. Function calling gives them a disciplined way to hand those jobs to real software. The key advantage over earlier prompt hacks is structure: because the output conforms to a declared schema, the surrounding program can parse and execute it without guessing, and modern implementations add strict validation, streaming, and ways to organize many related tools.

OpenAI added native function calling to its API in June 2023, and the idea quickly became the standard plumbing under nearly every AI agent and assistant. The later Model Context Protocol generalized the same concept into an open standard for advertising tools to any model. For a business reader, function calling is the simple but pivotal trick that lets a chatbot move from describing an action to actually taking it.

Sources

Last verified June 7, 2026