MCPcopy Create free account
hub / github.com/agentforce314/clawcodex / _status_summary

Function _status_summary

src/command_system/mcp_command.py:67–78  ·  view source on GitHub ↗

Verbatim port of ``_mcp_status_summary`` (mcp_dialogs.py:94-101), quirks intact: ``tool_suffix`` is always-plural (``"1 tools"``) and appears ONLY on ``connected``.

(server: dict[str, Any])

Source from the content-addressed store, hash-verified

65
66
67def _status_summary(server: dict[str, Any]) -> str:
68 """Verbatim port of ``_mcp_status_summary`` (mcp_dialogs.py:94-101), quirks intact:
69 ``tool_suffix`` is always-plural (``"1 tools"``) and appears ONLY on ``connected``."""
70 tools = server.get("tools") or []
71 tool_suffix = f" ({len(tools)} tools)" if tools else ""
72 status = server.get("status")
73 if status == "error":
74 err = server.get("error")
75 return f"error: {err}" if err else "error"
76 if status == "connected":
77 return f"connected{tool_suffix}"
78 return "disconnected"
79
80
81@dataclass(frozen=True)

Callers 1

runMethod · 0.85

Calls 1

getMethod · 0.45

Tested by

no test coverage detected