Function Calling
Summary
Function Calling — the ability of a model to call external programs: run code, query APIs and launch tools to solve tasks.
What it changes
An ordinary model only generates text. A model with function calling can act: when it sees the request "what is the weather in Moscow?", it does not invent an answer but calls the function get_weather("Moscow") and replies based on the real result.
How it works
- You describe the available functions to the model: name, parameters, what they do.
- The model decides which function to call and with which arguments.
- Your code runs the function and returns the result.
- The model inserts the result into its answer.
What you can connect
- weather, currency and maps APIs
- databases (SQL queries)
- calendars, email, messengers
- your own internal services
Why it matters
Function calling is the foundation of agents. This is how a model stops being a "talking head" and becomes an actor. It is the basis for MCP, LangChain and modern AI assistants.