AI State of the Art
Mistral/API Capabilities in Detail/16 min
Section 265

Mistral Function Calling: Design Patterns and Examples

Listen as a podcast →
Status as of July 2026

Classic function calling (you describe your functions, the model picks one) still exists and has not changed shape: it is the tools parameter of the /v1/chat/completions endpoint. What changed in 2026 is what you put in it. Since 22 May 2026 Mistral has been pushing MCP connectors: instead of redeclaring your tools in every request, you register an MCP server once and reuse it everywhere. The model line-up moved too: the models that support tool calling today are Mistral Medium 3.5, Mistral Small 4, Mistral Large 3 and Ministral 3.

Function Calling: Giving Your AI Hands

A standalone LLM (Large Language Model) can only generate text. It doesn't know the current weather. It can't query your database. It can't send an email or open a Jira ticket.

Function Calling changes that: you describe tools (functions), and the model can ask for one to be called when it is relevant. Suddenly the AI has hands. It can fetch fresh information and trigger a concrete action.

The Full Flow, Step by Step

Understanding the flow matters, because there is one important subtlety:

  1. You define tools: you describe functions with their name, description and parameters (in JSON Schema)
  2. The user asks a question that needs a tool ("What's the weather in Paris?")
  3. The model identifies the right tool and generates the arguments as JSON
  4. Your application executes the function (a weather API call, an SQL query, and so on)
  5. You send the result back to the model
  6. The model writes the final answer, incorporating the function result
Key Point: Who Executes What?

The model never executes the function itself. It emits descriptive JSON: "call function X with arguments Y." It is your application that executes. The model is the brain that decides; your application is the hand that acts. That separation is fundamental, and it is what keeps the control point on your side: nothing reaches a third party unless your code decided so.

Defining Tools with JSON Schema

Tools are declared in the request's tools array, in the format documented by Mistral:

{
  "type": "function",
  "function": {
    "name": "get_weather",
    "description": "Gets the current weather for a given city",
    "parameters": {
      "type": "object",
      "properties": {
        "city": {
          "type": "string",
          "description": "The name of the city"
        },
        "unit": {
          "type": "string",
          "enum": ["celsius", "fahrenheit"],
          "description": "Temperature unit"
        }
      },
      "required": ["city"]
    }
  }
}

Best practices for tool definitions:

  • Clear, detailed descriptions: this is the main quality lever. The model picks a tool based on its description. A vague description means bad routing.
  • Well-documented parameters: describe the expected format, the constraints, the defaults.
  • enum for fixed values: use enum whenever the possible values are known in advance.
  • Keep the list short and distinct: the more tools you add with overlapping descriptions, the more the model hesitates. If your catalogue grows, group tools by domain and expose only the ones relevant to the current conversation (the API lets you filter which tools a connector exposes, see below).

What the Model Sends Back

When the model decides to call a tool, its reply contains a tool_calls array. Each entry carries an id, a type of function, and a function object with name and arguments (the arguments come back as a JSON string).

You execute the function, then call the model again, appending a message with role tool that carries the content (the result) and the matching tool_call_id. That tool_call_id is what tells the model which result answers which call.

Steering the Behaviour: tool_choice and parallel_tool_calls

Two request parameters govern calling behaviour.

tool_choice controls whether the model may call a tool at all. The documentation describes three values:

ValueEffect
autoDefault mode. The model decides whether to use a tool.
anyForces tool use.
nonePrevents tool use.

The API specification additionally accepts required and a form that pins a specific function ({"type": "function", "function": {"name": "..."}}), for cases where you want to dictate exactly which tool will be called.

parallel_tool_calls controls how many tools may be called at once. At true (the default) the model decides for itself whether to emit several calls in one reply. At false you force it to emit one at a time.

Parallel Calls: Several Tools in One Turn

A concrete example: the user asks "Compare the weather in Paris and London."

  1. The model emits two get_weather calls in the same reply (one per city)
  2. Your application runs them in parallel
  3. You return both results, each with its own tool_call_id
  4. The model compares and writes its answer

The upside: instead of chaining two round trips with the model, everything happens in one exchange. You save a full round trip, which cuts perceived latency.

When to Turn Parallel Calls Off

Setting parallel_tool_calls to false looks like a step backwards, but it is sometimes exactly right. If your tools have side effects (creating a file, sending a document, debiting an account) serial execution gives you time to check the first result before authorising the second. Parallelism is a latency optimisation, not a goal in itself.

The Four Integration Patterns

Single tool: one tool defined, used when relevant. Example: a support chatbot querying a knowledge base. Simple, effective, easy to debug.

Multi-tool: several tools available, the model picks the right one. Example: an assistant handling calendar, email, tasks and document search.

Chained tools: one tool's output feeds the next. Example: look up a customer by name, fetch their orders, produce a summary. The model orchestrates the sequence.

Agentic: the model plans, runs a sequence of tools, and adapts as intermediate results come in. This is where the model has genuine decision-making autonomy, the territory of the Agents API.

From Local Function to MCP Connector

Function calling makes you describe your tools on every request. That is fine for three in-house functions. It becomes painful as soon as the tool is a real external service: you have to handle its authentication, its tool list, its versions, and copy all of it into every application.

That is the problem MCP (Model Context Protocol) solves, an open standard describing how a model discovers and calls the tools of an external service. Since 22 May 2026 Mistral exposes this mechanism under the name connectors: a connector is an MCP server registered once, then reusable across conversations, agents and direct tool calls, from any SDK or straight from the API, without managing MCP transport locally. Mistral ships built-in connectors (web search, code execution, image generation, document library) and lets you register your own.

In the request, a connector is used as a tool of type connector, referenced by its connector_id (its name or its UUID). A tool_configuration object filters what the model is allowed to call:

  • include: the allowlist of permitted tools;
  • exclude: the blocklist (the two cannot be used together);
  • requires_confirmation: a boolean that forces human approval before execution.
Why This Parameter Matters So Much

requires_confirmation and include/exclude are where internal policy turns into code. "The assistant may not send correspondence without review" stops being a pious wish: it becomes an allowlist of tools plus a confirmation flag, both written into the agent's configuration. This is the kind of setting you can put in a compliance file, because it is verifiable.

Which Models Can Do It

Mistral's documentation lists function calling among the capabilities of the current general-purpose models:

ModelVersionFunction calling
Mistral Medium 3.5v26.04Yes
Mistral Small 4v26.03Yes
Mistral Large 3v25.12Yes
Ministral 3 (14B, 8B, 3B)v25.12Yes
Codestralv25.08Yes
Voxtral Smallv25.07Yes

The specialised models mentioned elsewhere in this course (Magistral for reasoning, Devstral for code) could also call tools. Since April 2026 their capabilities have been absorbed into Mistral Medium 3.5, which tunes its reasoning effort per request instead of living as a separate model. The function calling documentation page still names some of these retired models: that is a leftover from the old line-up, not a parallel one.

Error Handling: The Three Problem Cases

Wrong tool chosen: the model picks an inappropriate tool. Fix: improve the descriptions, add examples in the system prompt, make sure tool names are clearly distinct, and shorten the exposed list.

Invalid parameters: the model produces incorrect or malformed arguments. Fix: validate arguments server-side before executing, every time. If they are invalid, return an explanatory error message so the model can correct itself.

External function failure: the API you call is down, the record does not exist, the service is under maintenance. Fix: return the formatted error to the model. It can then tell the user or propose another route.

Security: ALWAYS Validate Arguments

A malicious user can try to steer the model through prompt injection into calling an unauthorised function, or the right function with the wrong arguments. Three ground rules: validate arguments server-side (the model is not a security boundary), implement authorisation checks in your code rather than in the prompt, and never allow a destructive or irreversible action without explicit human confirmation.

A Format That Became a Standard

Mistral's tool format (type: function, then name, description and JSON Schema parameters) is the one the industry converged on; the shape of a tool call and the tool-role result message follow the same convention. In practice an application written for another provider ports to Mistral with few changes. That common ground widened further with MCP, which the major providers have adopted.

Real-World Use Cases

E-commerce: the user asks for a recommendation, the model searches the catalogue, checks stock, computes shipping, then proposes the order.

HR: an employee asks about remaining leave, the model queries the HRIS (Human Resources Information System), checks internal policy, suggests dates, and files the request.

Data analytics: a manager asks a business question, the model queries the database, runs the calculations, and produces a report.

Legal: a lawyer asks where a matter stands, the model queries the contract repository, extracts the deadlines, and drafts a letter, which nobody sends until a human has approved it.


Function Calling turns the model from a passive text generator into an agent that can act. But the base building block has not moved: you are still the one who executes. What changed in 2026 is the packaging, tools increasingly arrive through MCP connectors registered once and for all, with their own filtering and confirmation rules.