File tree Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ use crate::tools::web_fetch::WebFetchTool;
2323use crate :: tools:: web_search:: WebSearchTool ;
2424use crate :: tools:: write_to_file:: WriteToFileTool ;
2525use crate :: Config ;
26+ use anyhow:: Context ;
2627use anyhow:: Result ;
2728use futures:: StreamExt ;
2829use itertools:: Itertools ;
@@ -222,14 +223,13 @@ impl Agent {
222223 . unwrap_or ( ProtocolVersion :: V2025_03_26 ) ,
223224 )
224225 . build ( ) ;
225- match mcp_client. open ( ) . await {
226- Ok ( _) => { }
227- Err ( e) => {
228- tracing:: error!( "Failed to open MCP client: {}" , e) ;
229- continue ;
230- }
231- }
232- mcp_client. initialize ( ) . await ?;
226+ mcp_client
227+ . open ( )
228+ . await
229+ . with_context ( || format ! ( "Failed to open MCP client at {}" , config. url) ) ?;
230+ mcp_client. initialize ( ) . await . with_context ( || {
231+ format ! ( "Failed initialize MCP client at {}" , config. url)
232+ } ) ?;
233233 let tools_list_res = mcp_client. list_tools ( None , None ) . await ?;
234234
235235 agent_builder = tools_list_res
You can’t perform that action at this time.
0 commit comments