@@ -200,7 +200,7 @@ async def quickstart():
200200 schema ["properties" ] = props
201201
202202 logger .info (f"Loaded { len (tools )} tools from MCP" )
203- return create_agent (llm , tools ), toolbox
203+ return create_agent (llm , tools ), toolbox , tools
204204
205205
206206def _extract_assistant_text (result : dict ) -> str :
@@ -326,9 +326,8 @@ async def _get_agent():
326326 last_exc : Exception | None = None
327327 for attempt in range (1 , 6 ):
328328 try :
329- agent , mcp_client = await quickstart ()
330- bound_tools = getattr (agent , "tools" , None ) or []
331- if not bound_tools :
329+ agent , mcp_client , tools = await quickstart ()
330+ if not tools :
332331 logger .warning (
333332 "Toolbox returned 0 tools on attempt %d; retrying" , attempt ,
334333 )
@@ -344,7 +343,7 @@ async def _get_agent():
344343 await asyncio .sleep (min (2 ** attempt , 15 ))
345344 if last_exc is not None :
346345 raise last_exc
347- _agent , _mcp_client = await quickstart ()
346+ _agent , _mcp_client , _ = await quickstart ()
348347 return _agent
349348
350349
0 commit comments