@@ -41,7 +41,9 @@ def list_server_workflows(
4141 server_id = get_server_id (server )
4242
4343 print_server_info (server_name , server_type , server_id )
44- print_workflows_placeholder (status , limit , format )
44+
45+ # Show that this feature requires backend API support
46+ print_workflows_unavailable (status , limit , format )
4547
4648
4749def print_server_info (server_name : str , server_type : str , server_id : str ) -> None :
@@ -58,135 +60,64 @@ def print_server_info(server_name: str, server_type: str, server_id: str) -> Non
5860 )
5961
6062
61- def print_workflows_placeholder (status_filter : Optional [str ], limit : Optional [int ], output_format : str ) -> None :
62- """Print workflows information placeholder ."""
63+ def print_workflows_unavailable (status_filter : Optional [str ], limit : Optional [int ], output_format : str ) -> None :
64+ """Print message that workflow listing is not available without backend support ."""
6365
6466 if output_format == "json" :
65- _print_workflows_json (status_filter , limit )
67+ _print_workflows_unavailable_json (status_filter , limit )
6668 elif output_format == "yaml" :
67- _print_workflows_yaml (status_filter , limit )
69+ _print_workflows_unavailable_yaml (status_filter , limit )
6870 else :
69- _print_workflows_text (status_filter , limit )
71+ _print_workflows_unavailable_text (status_filter , limit )
7072
7173
72- def _print_workflows_json (status_filter : Optional [str ], limit : Optional [int ]) -> None :
73- """Print workflows in JSON format."""
74- workflows_data = {
75- "status" : "not_implemented" ,
76- "message" : "Workflow listing by server not yet implemented" ,
77- "filters" : {
74+ def _print_workflows_unavailable_json (status_filter : Optional [str ], limit : Optional [int ]) -> None :
75+ """Print workflow unavailability message in JSON format."""
76+ error_data = {
77+ "error" : "workflow_listing_unavailable" ,
78+ "message" : "Workflow listing by server requires backend API support" ,
79+ "detail" : "No workflow listing API exists. Only individual workflow lookup via workflow ID is supported." ,
80+ "requested_filters" : {
7881 "status" : status_filter ,
7982 "limit" : limit
8083 },
81- "sample_workflows" : [
82- {
83- "workflow_id" : "wf_example123" ,
84- "name" : "data-processor" ,
85- "status" : "running" ,
86- "created_at" : "2024-01-15T10:30:00Z" ,
87- "run_id" : "run_abc456"
88- },
89- {
90- "workflow_id" : "wf_example456" ,
91- "name" : "email-sender" ,
92- "status" : "completed" ,
93- "created_at" : "2024-01-15T09:15:00Z" ,
94- "run_id" : "run_def789"
95- }
96- ],
97- "available_fields" : [
98- "workflow_id" ,
99- "name" ,
100- "status" ,
101- "created_at" ,
102- "run_id" ,
103- "duration" ,
104- "performance_metrics"
105- ]
84+ "alternative" : "Use 'mcp-agent cloud workflow status --id <workflow-id>' for individual workflow details"
10685 }
107- print (json .dumps (workflows_data , indent = 2 ))
86+ print (json .dumps (error_data , indent = 2 ))
10887
10988
110- def _print_workflows_yaml (status_filter : Optional [str ], limit : Optional [int ]) -> None :
111- """Print workflows in YAML format."""
112- workflows_data = {
113- "status" : "not_implemented" ,
114- "message" : "Workflow listing by server not yet implemented" ,
115- "filters" : {
89+ def _print_workflows_unavailable_yaml (status_filter : Optional [str ], limit : Optional [int ]) -> None :
90+ """Print workflow unavailability message in YAML format."""
91+ error_data = {
92+ "error" : "workflow_listing_unavailable" ,
93+ "message" : "Workflow listing by server requires backend API support" ,
94+ "detail" : "No workflow listing API exists. Only individual workflow lookup via workflow ID is supported." ,
95+ "requested_filters" : {
11696 "status" : status_filter ,
11797 "limit" : limit
11898 },
119- "sample_workflows" : [
120- {
121- "workflow_id" : "wf_example123" ,
122- "name" : "data-processor" ,
123- "status" : "running" ,
124- "created_at" : "2024-01-15T10:30:00Z" ,
125- "run_id" : "run_abc456"
126- },
127- {
128- "workflow_id" : "wf_example456" ,
129- "name" : "email-sender" ,
130- "status" : "completed" ,
131- "created_at" : "2024-01-15T09:15:00Z" ,
132- "run_id" : "run_def789"
133- }
134- ],
135- "available_fields" : [
136- "workflow_id" ,
137- "name" ,
138- "status" ,
139- "created_at" ,
140- "run_id" ,
141- "duration" ,
142- "performance_metrics"
143- ]
99+ "alternative" : "Use 'mcp-agent cloud workflow status --id <workflow-id>' for individual workflow details"
144100 }
145- print (yaml .dump (workflows_data , default_flow_style = False ))
101+ print (yaml .dump (error_data , default_flow_style = False ))
146102
147103
148- def _print_workflows_text (status_filter : Optional [str ], limit : Optional [int ]) -> None :
149- """Print workflows in text format."""
150- table = Table (title = "Server Workflows (Placeholder)" )
151- table .add_column ("Workflow ID" , style = "cyan" )
152- table .add_column ("Name" , style = "green" )
153- table .add_column ("Status" , style = "yellow" )
154- table .add_column ("Created" , style = "magenta" )
155- table .add_column ("Run ID" , style = "blue" )
156- table .add_row (
157- "wf_example123" ,
158- "data-processor" ,
159- "🔄 Running" ,
160- "2024-01-15 10:30:00" ,
161- "run_abc456"
162- )
163- table .add_row (
164- "wf_example456" ,
165- "email-sender" ,
166- "✅ Completed" ,
167- "2024-01-15 09:15:00" ,
168- "run_def789"
169- )
170-
171- console .print ("\n " )
172- console .print (table )
173-
104+ def _print_workflows_unavailable_text (status_filter : Optional [str ], limit : Optional [int ]) -> None :
105+ """Print workflow unavailability message in text format."""
174106 console .print (
175107 Panel (
176- f"[yellow]🚧 Workflow listing by server not yet implemented[/yellow ]\n \n "
177- f"Applied filters:\n "
108+ f"[red]❌ Workflow listing unavailable[/red ]\n \n "
109+ f"Requested filters:\n "
178110 f"• Status: [cyan]{ status_filter or 'All' } [/cyan]\n "
179111 f"• Limit: [cyan]{ limit or 'No limit' } [/cyan]\n \n "
180- f"This command is ready to display workflows running on this server including:\n "
181- f"• Workflow ID and execution details\n "
182- f"• Workflow name and type\n "
183- f"• Current execution status\n "
184- f"• Creation timestamp and run ID\n "
185- f"• Duration and performance metrics\n \n "
186- f"The backend API needs to be extended to support listing workflows\n "
187- f"by server/app ID using the AppSpecifier from the workflow proto." ,
188- title = "Implementation Status" ,
189- border_style = "yellow" ,
112+ f"[yellow]Issue:[/yellow] No workflow listing API exists in the backend.\n "
113+ f"Only individual workflow lookup is supported.\n \n "
114+ f"[blue]Alternative:[/blue] Use individual workflow commands:\n "
115+ f"• [cyan]mcp-agent cloud workflow status --id <workflow-id>[/cyan]\n \n "
116+ f"[dim]To implement this feature, the backend would need:\n "
117+ f"• A workflow listing API endpoint\n "
118+ f"• Server/app filtering support in workflow queries[/dim]" ,
119+ title = "Workflow Listing Not Available" ,
120+ border_style = "red" ,
190121 expand = False ,
191122 )
192123 )
0 commit comments