zed-industries/zed · error

Mistral does not support custom tool calls

Error message

Mistral does not support custom tool calls

What it means

Raised in into_mistral: the request contained a custom tool call that the Mistral provider's message conversion does not support, so conversion aborts. The provider cannot express the tool in its request format.

Solutions

  1. Avoid custom tools with Mistral models
  2. Pick a provider that supports custom tool input
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at crates/language_models/src/provider/mistral.rs:463 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of zed-industries/zed@916fc2b8cb (2026-08-20). Data as JSON: /api/errors/14c0f69a65d8f499. Report an issue: GitHub.

Appendix: source

Thrown at crates/language_models/src/provider/mistral.rs:464

                                tool_calls: Vec::new(),
                            });
                        }
                        MessageContent::Thinking { text, .. } => {
                            if model.supports_thinking() {
                                messages.push(mistral::RequestMessage::Assistant {
                                    content: Some(mistral::MessageContent::Multipart {
                                        content: vec![mistral::MessagePart::Thinking {
                                            thinking: vec![mistral::ThinkingPart::Text {
                                                text: text.clone(),
                                            }],
                                        }],
                                    }),
                                    tool_calls: Vec::new(),
                                });
                            }
                        }
                        MessageContent::RedactedThinking(_) => {}
                        MessageContent::Image(_) => {}
                        MessageContent::Compaction(_) => {}
                        MessageContent::ToolUse(tool_use) => {
                            let input = tool_use.input.as_json().ok_or_else(|| {
                                anyhow!("Mistral does not support custom tool calls")
                            })?;
                            let tool_call = mistral::ToolCall {
                                id: tool_use.id.to_string(),
                                content: mistral::ToolCallContent::Function {
                                    function: mistral::FunctionContent {
                                        name: tool_use.name.to_string(),
                                        arguments: serde_json::to_string(input).unwrap_or_default(),
                                    },
                                },
                            };

                            if let Some(mistral::RequestMessage::Assistant { tool_calls, .. }) =
                                messages.last_mut()
                            {

View on GitHub (pinned to 916fc2b8cb)