{"record":{"id":"08c031ae38336278","repo":"zed-industries/zed","slug":"copilot-chat-does-not-support-custom-tools","errorCode":null,"errorMessage":"Copilot Chat does not support custom tools","messagePattern":"Copilot Chat does not support custom tools","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/copilot_chat/src/model.rs","lineNumber":980,"sourceCode":"                content: message.string_contents(),\n            }),\n        }\n    }\n\n    let tools = request\n        .tools\n        .iter()\n        .map(|tool| match &tool.input {\n            language_model::LanguageModelRequestToolInput::Function { input_schema, .. } => {\n                Ok(Tool::Function {\n                    function: Function {\n                        name: tool.name.clone(),\n                        description: tool.description.clone(),\n                        parameters: input_schema.clone(),\n                    },\n                })\n            }\n            language_model::LanguageModelRequestToolInput::Custom { .. } => Err(anyhow::anyhow!(\n                \"Copilot Chat does not support custom tools\"\n            )),\n        })\n        .collect::<Result<Vec<_>>>()?;\n\n    Ok(CopilotChatRequest {\n        n: 1,\n        stream: model.uses_streaming(),\n        temperature: temperature.unwrap_or(0.1),\n        model: model.id().to_string(),\n        messages,\n        tools,\n        tool_choice: tool_choice.map(|choice| match choice {\n            LanguageModelToolChoice::Auto => ToolChoice::Auto,\n            LanguageModelToolChoice::Any => ToolChoice::Required,\n            LanguageModelToolChoice::None => ToolChoice::None,\n        }),\n        thinking_budget: if thinking_allowed && model.supports_thinking() {","sourceCodeStart":962,"sourceCodeEnd":998,"githubUrl":"https://github.com/zed-industries/zed/blob/f4178619acd0d47ea1f76a2025c42962c6d6638c/crates/copilot_chat/src/model.rs#L962-L998","documentation":"While converting the request's tools to Copilot Chat format, a tool whose input is not a plain function (e.g. an MCP-style tool) was found; Copilot Chat only accepts function tools, so the request is rejected before it is sent.","triggerScenarios":"Thrown at crates/copilot_chat/src/model.rs:980 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Exclude non-function tools from Copilot Chat requests","Use a model provider that supports the required tool types"],"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"}