@@ -556,7 +556,6 @@ async def _filter_tools(self) -> None:
556556
557557 all_tools = await self .mcp_client .list_tools ()
558558
559-
560559 response_tools_by_server : dict [str , str ] = {} # server_name -> tool_name
561560 for tool in all_tools :
562561 if "response" in tool .name or tool .name == "response" :
@@ -579,7 +578,9 @@ async def _filter_tools(self) -> None:
579578 for server_name in reversed (server_names ):
580579 if server_name in response_tools_by_server :
581580 response_tool_name = response_tools_by_server [server_name ]
582- self .console .debug (f"Found response tool '{ response_tool_name } ' from server '{ server_name } '" )
581+ self .console .debug (
582+ f"Found response tool '{ response_tool_name } ' from server '{ server_name } '"
583+ )
583584 break
584585
585586 # Fallback to any response tool
@@ -593,10 +594,12 @@ async def _filter_tools(self) -> None:
593594 self .response_tool_name = response_tool_name
594595 self .lifecycle_tools .append (response_tool_name )
595596 elif response_tool_name :
596- self .console .debug (f"Response tool '{ response_tool_name } ' already in lifecycle_tools" )
597+ self .console .debug (
598+ f"Response tool '{ response_tool_name } ' already in lifecycle_tools"
599+ )
597600 self .response_tool_name = response_tool_name
598601 else :
599- self .console .debug (f "No response tools found or no mcp_config" )
602+ self .console .debug ("No response tools found or no mcp_config" )
600603
601604 # Filter tools
602605 self ._available_tools = []
@@ -610,7 +613,7 @@ async def _filter_tools(self) -> None:
610613 for tool in all_tools :
611614 # Lifecycle tools (setup, evaluate, response) should always be included
612615 is_lifecycle = tool .name in self .lifecycle_tools
613-
616+
614617 # Check if tool should be included
615618 if not is_lifecycle :
616619 if self .allowed_tools and tool .name not in self .allowed_tools :
@@ -620,7 +623,9 @@ async def _filter_tools(self) -> None:
620623 self .console .debug (f"Skipping tool '{ tool .name } ' - in disallowed_tools" )
621624 continue
622625
623- self .console .debug (f"Adding tool '{ tool .name } ' to available tools (lifecycle={ is_lifecycle } )" )
626+ self .console .debug (
627+ f"Adding tool '{ tool .name } ' to available tools (lifecycle={ is_lifecycle } )"
628+ )
624629 self ._available_tools .append (tool )
625630 self ._tool_map [tool .name ] = tool
626631
0 commit comments