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])
| 65 | |
| 66 | |
| 67 | def _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) |