Skip to content

Commit db8087b

Browse files
committed
fix: display workflow
1 parent 6ee23b3 commit db8087b

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

uns_mcp/server.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -304,20 +304,23 @@ async def get_workflow_info(ctx: Context, workflow_id: str) -> str:
304304
response = await client.workflows.get_workflow_async(
305305
request=GetWorkflowRequest(workflow_id=workflow_id),
306306
)
307-
307+
308308
info: WorkflowInformation = response.workflow_information
309309

310310
result = ["Workflow Information:"]
311311
result.append(f"Name: {info.name}")
312312
result.append(f"ID: {info.id}")
313313
result.append(f"Status: {info.status.value}")
314-
result.append(f"Type: {info.workflow_type.value}")
314+
if info.workflow_type is None:
315+
result.append("Type: Undefined")
316+
else:
317+
result.append(f"Type: {info.workflow_type.value}")
315318

316319
result.append("\nSources:")
317320
for source in info.sources:
318321
result.append(f" - {source}")
319322

320-
if info.workflow_type == WorkflowType.CUSTOM.value:
323+
if info.workflow_type and info.workflow_type == WorkflowType.CUSTOM.value:
321324
result.append("\nWorkflow Nodes:")
322325
for node in info.workflow_nodes:
323326
result.append(f" - {node.name} (Type: {node.type.value}) (Subtype: {node.subtype}):")

0 commit comments

Comments
 (0)