Function Calling
Function calling is a capability that lets a language model request the execution of an external function or API rather than answering from memory alone. The developer describes each available function with a name, a description, and a parameter schema, usually expressed in JSON. When the model decides a function is needed, it returns a structured call with filled-in arguments instead of prose. The application runs that function, feeds the result back into the conversation, and the model writes its final answer using the returned data. This is the mechanism behind assistants that check live prices, query an internal database, send an email, or run code. OpenAI, Google, and Anthropic all expose it, with Anthropic calling the same idea tool use, and agent frameworks build multi-step loops on top of it. The Model Context Protocol standardizes how such tools are packaged and discovered so they can be reused across applications. The usual pitfall is a vague parameter schema. If descriptions are ambiguous or types are loose, the model supplies plausible but wrong arguments, so schemas should be strict and every call validated before execution. Function calling also does not make a model trustworthy by itself; the calling application still enforces permissions and error handling.