{"record":{"id":"14c0f69a65d8f499","repo":"zed-industries/zed","slug":"mistral-does-not-support-custom-tool-calls","errorCode":null,"errorMessage":"Mistral does not support custom tool calls","messagePattern":"Mistral does not support custom tool calls","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/language_models/src/provider/mistral.rs","lineNumber":463,"sourceCode":"                            if model.supports_thinking() {\n                                messages.push(mistral::RequestMessage::Assistant {\n                                    content: Some(mistral::MessageContent::Multipart {\n                                        content: vec![mistral::MessagePart::Thinking {\n                                            thinking: vec![mistral::ThinkingPart::Text {\n                                                text: text.clone(),\n                                            }],\n                                        }],\n                                    }),\n                                    tool_calls: Vec::new(),\n                                });\n                            }\n                        }\n                        MessageContent::RedactedThinking(_) => {}\n                        MessageContent::Image(_) => {}\n                        MessageContent::Compaction(_) => {}\n                        MessageContent::ToolUse(tool_use) => {\n                            let input = tool_use.input.as_json().ok_or_else(|| {\n                                anyhow!(\"Mistral does not support custom tool calls\")\n                            })?;\n                            let tool_call = mistral::ToolCall {\n                                id: tool_use.id.to_string(),\n                                content: mistral::ToolCallContent::Function {\n                                    function: mistral::FunctionContent {\n                                        name: tool_use.name.to_string(),\n                                        arguments: serde_json::to_string(input).unwrap_or_default(),\n                                    },\n                                },\n                            };\n\n                            if let Some(mistral::RequestMessage::Assistant { tool_calls, .. }) =\n                                messages.last_mut()\n                            {\n                                tool_calls.push(tool_call);\n                            } else {\n                                messages.push(mistral::RequestMessage::Assistant {\n                                    content: None,","sourceCodeStart":445,"sourceCodeEnd":481,"githubUrl":"https://github.com/zed-industries/zed/blob/f4178619acd0d47ea1f76a2025c42962c6d6638c/crates/language_models/src/provider/mistral.rs#L445-L481","documentation":"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.","triggerScenarios":"Thrown at crates/language_models/src/provider/mistral.rs:463 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Avoid custom tools with Mistral models","Pick a provider that supports custom tool input"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"f4178619acd0d47ea1f76a2025c42962c6d6638c","analyzedAt":"2026-08-20T19:29:52.058Z","contentChangedAt":"2026-08-20T19:29:52.058Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}