Introduction to Function Calling
On this page
Update November 2, 2026 — Models. Mistral Large 3 (
mistral-large-2512) and Mistral Medium 3.5 were deprecated on October 31, 2026, and will be retired on April 30, 2027. Their designated successor, Mistral Large 4 (mistral-large-4), has been in public preview since October 6. The examples in this course use the aliasmistral-large-latest, which currently points to Mistral Large 3 according to its official specification (verified November 3, 2026). Similarly,mistral-medium-latestpoints to Mistral Medium 3.5. These aliases will remain valid until April 30, 2027. For new projects, testmistral-large-4, their designated successor.
Why function calling changes everything
Large language models like those from Mistral AI are exceptionally good at understanding and generating text. In the real world, that is rarely enough. Answering “Where is my order?” requires querying a database. Confirming a payment means checking, or even triggering, a transaction. Scheduling an appointment requires reading a calendar. Function calling is the mechanism that lets an LLM cross the boundary between text and action.
The process involves three steps. The model decides it needs to call an external function, generates the required arguments in JSON format, and then lets your code execute the function and return the result. At no point does the model touch your systems directly: you retain full control.
The LLM + Tools architecture
Everything relies on a strict separation of responsibilities. It is worth stating this precisely because the rest of the course builds on it. The model understands the user’s request, selects the right function, and drafts the arguments. Your code, and your code alone, actually executes that function, accesses the data, and returns the result. The model then takes over again to turn that raw result into a natural response.
The advantage is significant: the model never has direct access to your systems and cannot execute arbitrary code. It simply expresses an intent—“I would like to call this function with these parameters”—and your application decides what to do with it. A request to delete an account can thus be refused, logged, or subjected to confirmation before any execution occurs.
# Simplified view of the flow
user = "What is the status of order #4521?"
# 1. The model analyzes and decides
# → "I need to call get_order_status with order_id=4521"
# 2. Your code executes
result = get_order_status(order_id=4521)
# → {"status": "shipped", "tracking": "FR123456789"}
# 3. The model formulates the response
# → "Your order #4521 has been shipped. Here is your tracking number: FR123456789."
Notice the data path in this example: the tracking number FR123456789 exists nowhere in the model’s knowledge. It comes from your system, passes through the result message, and ends up in a sentence the user can read. This is exactly what function calling makes possible.
Which Mistral models support function calling?
All major Mistral models support this feature. Among the general-purpose models, you have Mistral Large 3, Medium 3.5, Small 4, and Ministral 3 in its three sizes (14B, 8B, 3B). On the specialized side, Devstral 2.0, Devstral Small 2, and Codestral also expose it. Magistral Medium and Small offered it as well, but that family is now deprecated: reasoning capabilities are now integrated into Mistral Small 4 and Medium 3.5.
Your choice depends on your use case. For complex function calls with many parameters and subtle trade-offs between multiple tools, Mistral Large 3 remains the most reliable. For simple, high-throughput production cases—an assistant querying two or three well-defined functions thousands of times a day—Mistral Small 4 offers an excellent cost-performance ratio.
Typical use cases
Applications are more diverse than they appear. A conversational assistant connected to a CRM, ERP, or ticketing database answers consultation questions: the model reads but modifies nothing. Automation goes further by triggering workflows—sending an email, creating a task, updating a status—and therefore carries much heavier responsibility on the code side. In augmented search (RAG), function calling shifts the decision: instead of systematically querying a vector database, you let the model decide when and how to do so, avoiding the injection of unnecessary context.
Two more ambitious use cases complete the picture. Autonomous agents chain multiple function calls to accomplish a complex task, with each result guiding the next call. Finally, natural interfaces allow a user to pilot an entire application through conversation, without ever needing to learn where a specific button is located.
What you will learn in this course
The course consists of fourteen lessons and follows a deliberately linear progression. You will start with fundamental concepts: the five-step process and the JSON schemas that describe your functions. You will then move to Python implementation—writing, calling, executing, and chaining functions with the Mistral SDK. The third block covers advanced features: parallel calls, tool_choice options, error handling, and security. The course concludes with real-world use cases—a payment tracker, an automated CRM—and production best practices.
By the end of this course, you will be able to design, implement, and deploy a robust function calling system with the Mistral API.
Key takeaways
- Function calling allows the model to request the execution of a function without executing it itself
- The architecture relies on a strict separation: the model generates arguments, your code executes
- All major Mistral models support this feature
- Function calling is the building block for AI agents and conversational automation