Category · Tools and protocols
What is function calling?
Function calling is when the model asks for a function, described by a schema, to be run. The model does not run it; the code does, and sends the result back. The code also decides whether the call is allowed.
By Laurent Poupet, Claude trainer and artificial intelligence architect · Updated
How it works
- The available functions are described to the model in every request, with a parameter schema, and it can request several at once when they are independent.
- The model can get the arguments wrong; its proposal is therefore always validated against the schema before running, and the error is sent back if it needs fixing.
- It is the basic building block shared by almost all model interfaces, and it is what MCP (Model Context Protocol) standardises between applications and tool servers.
The trap to avoid
The trap is handing it the permissions; the code decides whether the call is allowed for this user, never the model.
Related terms
- Hooks in a coding assistantDevelopment and code
- MCP (Model Context Protocol)Tools and protocols
- FastMCPTools and protocols
Where this is taught
Track 4 · Programming with Claude and going live
Tool Use: Schemas and Loopslesson 3 · 1 hour
Lesson content (step-by-step instructions, exercises with solutions, quizzes) is for students only, with an access code received after the first lesson.