{"record":{"id":"aefcc13ab318294a","repo":"zed-industries/zed","slug":"context-server-not-initialized","errorCode":null,"errorMessage":"Context server not initialized","messagePattern":"Context server not initialized","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/agent/src/tools/context_server_registry.rs","lineNumber":365,"sourceCode":"        let tool_name = self.tool.name.clone();\n        let tool_id = mcp_tool_id(&self.server_id.0, &self.tool.name);\n        let display_name = self.tool.name.clone();\n        let initial_title = self.initial_title(serde_json::Value::Null, cx);\n        let authorize =\n            event_stream.authorize_third_party_tool(initial_title, tool_id, display_name, cx);\n\n        cx.spawn(async move |cx| {\n            let input = input\n                .recv()\n                .await\n                .map_err(|e| anyhow::anyhow!(e.to_string()))?;\n\n            authorize\n                .await\n                .map_err(|e| anyhow::anyhow!(e.to_string()))?;\n\n            let Some(protocol) = server.client() else {\n                return Err(anyhow::anyhow!(\"Context server not initialized\").into());\n            };\n\n            let arguments = if let serde_json::Value::Object(map) = input {\n                Some(map.into_iter().collect())\n            } else {\n                None\n            };\n\n            log::trace!(\n                \"Running tool: {} with arguments: {:?}\",\n                tool_name,\n                arguments\n            );\n\n            let request = protocol.request::<context_server::types::requests::CallTool>(\n                context_server::types::CallToolParams {\n                    name: tool_name,\n                    arguments,","sourceCodeStart":347,"sourceCodeEnd":383,"githubUrl":"https://github.com/zed-industries/zed/blob/f4178619acd0d47ea1f76a2025c42962c6d6638c/crates/agent/src/tools/context_server_registry.rs#L347-L383","documentation":"Raised in the context-server tool's run when the MCP server is registered but not currently initialized/connected, so its tool cannot be invoked. Typically the server failed to start or is still connecting; the run aborts before sending input.","triggerScenarios":"Thrown at crates/agent/src/tools/context_server_registry.rs:365 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Wait for the context server to finish initializing and retry the tool call","Restart the context server if initialization failed permanently","Check server logs/startup command for the initialization failure"],"exampleFix":null,"handlingStrategy":"retry","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-23T08:17:48.524Z"}