check_tcp_connect
Checks whether a remote Linux host can open a TCP connection to a target host and port via SSH, helping diagnose service reachability without sending data.
Instructions
Checks FROM a remote Linux host (reached via SSH) whether a TCP connection to target_host:target_port can be opened (nc -vz). USE THIS TOOL to tell whether a service (database, API, another server) is reachable from that host. target_host is a hostname or an IPv4/IPv6 address, target_port is 1-65535. Do not confuse them with host/port, which are the SSH connection to the machine the check runs on. Only the connection is opened and closed, no data is sent. One port per call. ok=True means the port accepted the connection. Otherwise nc's message tells why: 'Connection refused' - the target is reachable but nothing listens on the port; 'timed out' - no answer in 3 seconds, usually a firewall or a routing problem; a name resolution error - check the name with get_dns_lookup. Fails with exit code 127 if nc is not installed on the host.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"target_host": "<target_host>",
"target_port": "<target_port>",
"host": "<host>",
"user": "<user>"
},
"name": "check_tcp_connect"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| host | Yes | ||
| port | No | ||
| user | Yes | ||
| timeout | No | ||
| key_path | No | ||
| password | No | ||
| target_host | Yes | ||
| target_port | Yes | ||
| accept_new_hostkey | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||