Skip to content

Commit b2fb395

Browse files
committed
cleanup
1 parent 1dcacd9 commit b2fb395

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

mcp_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ async def list_tools_from_server(workload: dict[str, Any]) -> dict[str, Any]:
232232
"error": f"Transport/proxy mode '{proxy_mode or transport_type}' not yet supported",
233233
}
234234

235-
except asyncio.TimeoutError:
235+
except TimeoutError:
236236
return {
237237
"workload": name,
238238
"status": "error",

toolhive_client.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -70,16 +70,17 @@ async def _is_toolhive_available(
7070
)
7171
response.raise_for_status()
7272
data = response.json()
73-
if not isinstance(data, dict) or "version" not in data:
74-
raise ConnectionError(
75-
f"Port {port} on host {host} did not respond with ToolHive format"
76-
)
77-
return (port, port)
7873
except (httpx.HTTPError, OSError) as e:
7974
raise ConnectionError(
8075
f"ToolHive not available at {host}:{port}: {e}"
8176
)
8277

78+
if not isinstance(data, dict) or "version" not in data:
79+
raise ConnectionError(
80+
f"Port {port} on host {host} did not respond with ToolHive format"
81+
)
82+
return (port, port)
83+
8384

8485
async def _scan_for_toolhive_async(
8586
host: str,
@@ -109,7 +110,7 @@ async def _scan_for_toolhive_async(
109110
),
110111
timeout=total_timeout,
111112
)
112-
except asyncio.TimeoutError:
113+
except TimeoutError:
113114
raise ConnectionError(
114115
f"ToolHive port scan timed out after {total_timeout}s "
115116
f"on {host} in port range {scan_port_start}-{scan_port_end}"

0 commit comments

Comments
 (0)