{"record":{"id":"9f2dac2e0a470d45","repo":"zed-industries/zed","slug":"ollama-does-not-support-custom-tool-calls","errorCode":null,"errorMessage":"Ollama does not support custom tool calls","messagePattern":"Ollama does not support custom tool calls","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/language_models/src/provider/ollama.rs","lineNumber":434,"sourceCode":"                    for content in msg.content.into_iter() {\n                        match content {\n                            MessageContent::Text(text) => {\n                                text_content.push_str(&text);\n                            }\n                            MessageContent::Thinking { text, .. } if !text.is_empty() => {\n                                thinking = Some(text)\n                            }\n                            MessageContent::ToolUse(tool_use) => {\n                                tool_calls.push(OllamaToolCall {\n                                    id: tool_use.id.to_string(),\n                                    function: OllamaFunctionCall {\n                                        name: tool_use.name.to_string(),\n                                        arguments: match tool_use.input {\n                                            language_model::LanguageModelToolUseInput::Json(\n                                                input,\n                                            ) => input,\n                                            language_model::LanguageModelToolUseInput::Text(_) => {\n                                                return Err(anyhow::anyhow!(\n                                                    \"Ollama does not support custom tool calls\"\n                                                ));\n                                            }\n                                        },\n                                    },\n                                });\n                            }\n                            _ => (),\n                        }\n                    }\n                    messages.push(ChatMessage::Assistant {\n                        content: text_content,\n                        tool_calls: Some(tool_calls),\n                        images: if images.is_empty() {\n                            None\n                        } else {\n                            Some(images)\n                        },","sourceCodeStart":416,"sourceCodeEnd":452,"githubUrl":"https://github.com/zed-industries/zed/blob/f4178619acd0d47ea1f76a2025c42962c6d6638c/crates/language_models/src/provider/ollama.rs#L416-L452","documentation":"Raised during Ollama request conversion (OllamaFunctionCall path): the incoming language-model request uses custom tool calls that the Ollama provider's conversion does not support, so it errors instead of silently dropping the tool.","triggerScenarios":"Thrown at crates/language_models/src/provider/ollama.rs:434 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Disable custom tools with Ollama models","Use Ollama's native tool schema (built-in tool definitions) instead"],"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-14T00:17:10.932Z"}