noun · AI feature
Function calling
also called tool calling API
Filling in a form instead of writing an essay. The AI hands back a name and a set of blanks that your code can read.
A model feature where you declare functions with typed parameters and the model returns a function name plus arguments as structured data for your code to execute.
You describe each function with a name and a schema for its inputs. When the model decides one fits, it outputs the function name and arguments as structured data instead of prose, and your code decides whether and how to run it.
Real-life example
You build a booking assistant and describe a function called book_table with a date, a time and a party size. A user writes "table for four on Friday at seven". The model sends back book_table with those three values filled in, and your code books the table. The sentence became data your program can use.
Where the analogy breaks
-
The model does not call anything. It returns data that says which function it wants and with what values. Running it is your code's job.
-
The values can be wrong or missing. Check every argument before using it, as you would for input from any user.
-
Giving it many functions can make it worse. Each added option is more to choose between, so keep the list short and the descriptions clear.