File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -12,14 +12,19 @@ def list_tools():
1212 List all available tools by category.
1313 """
1414 tools = get_all_tools ()
15- curr_category = None
16-
15+ categories = {}
16+
17+ # Group tools by category
18+ for tool in tools :
19+ if tool .category not in categories :
20+ categories [tool .category ] = []
21+ categories [tool .category ].append (tool )
22+
1723 print ("\n \n Available AgentStack Tools:" )
18- for category , tools in itertools .groupby (tools , lambda x : x .category ):
19- if curr_category != category :
20- print (f"\n { category } :" )
21- curr_category = category
22- for tool in tools :
24+ # Display tools by category
25+ for category in sorted (categories .keys ()):
26+ print (f"\n { category } :" )
27+ for tool in categories [category ]:
2328 print (" - " , end = '' )
2429 print (term_color (f"{ tool .name } " , 'blue' ), end = '' )
2530 print (f": { tool .url if tool .url else 'AgentStack default tool' } " )
You can’t perform that action at this time.
0 commit comments