# language_models: Add tool use support for Mistral models \(\#29994\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/926f377c6cea604446d843c5e7f385219feb062a)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: 926f377c6cea604446d843c5e7f385219feb062a

Requested commit: 926f377c6cea604446d843c5e7f385219feb062a

Commit: 926f377c6cea604446d843c5e7f385219feb062a

Tree: 7516822a5ea68693b25d6f5e4d2081377d6020ce

Author: Umesh Yadav

Committer: GitHub

## Message

```
language_models: Add tool use support for Mistral models (#29994)

Closes https://github.com/zed-industries/zed/issues/29855

Implement tool use handling in Mistral provider, including mapping tool
call events and updating request construction. Add support for
tool_choice and parallel_tool_calls in Mistral API requests.

This works fine with all the existing models. Didn't touched anything
else but for future. Fetching models using their models api, deducting
tool call support, parallel tool calls etc should be done from model
data from api response.

<img width="547" alt="Screenshot 2025-05-06 at 4 52 37 PM"
src="https://github.com/user-attachments/assets/4c08b544-1174-40cc-a40d-522989953448"
/>

Tasks:

- [x] Add tool call support
- [x] Auto Fetch models using mistral api
- [x] Add tests for mistral crates.
- [x] Fix mistral configurations for llm providers.

Release Notes:

- agent: Add tool call support for existing mistral models

---------

Co-authored-by: Peter Tripp <peter@zed.dev>
Co-authored-by: Bennet Bo Fenner <bennet@zed.dev>
```

## Parents

- [26a8cac0d8d963992242955a1ce1398ec8358354](https://git.cafe/gitcafe/zed/commit/26a8cac0d8d963992242955a1ce1398ec8358354?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/926f377c6cea604446d843c5e7f385219feb062a?format=markdown)
