Local Connections
local_connectionsShow active TCP/UDP network connections and listening ports with local/remote addresses and state. Filter by all, listen, or established to diagnose network activity.
Instructions
Show active network connections and listening ports.
Displays TCP/UDP sockets with local/remote addresses and state. Uses ss on Linux (netstat as a fallback) and netstat on macOS and Windows. ss filters by state natively; netstat on macOS, Windows and older Linux has no state filter, so for 'listen' and 'established' this tool filters the output lines itself after the command runs and says so in the note field. Does not require admin privileges (PIDs may require admin).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| state | No | Which sockets to show: 'all' (default), 'listen' (listening TCP ports only) or 'established' (connected TCP sessions only). | all |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| note | No | Additional context about the result | |
| error | No | Why the tool could not produce a result: input validation failure, tool disabled by configuration, binary not installed, or no service answered. Empty when the command executed. | |
| stderr | Yes | Standard error of the command, or the failure message when the command did not run | |
| stdout | Yes | Standard output of the command (curl output is capped at 10,000 characters) | |
| command | Yes | The exact command line that was executed, or the tool name if the command never ran | |
| success | Yes | True when the command ran and exited with status 0 | |
| platform | Yes | Operating system the command ran on (Darwin, Linux or Windows) | |
| returncode | Yes | Process exit status. 0 = success; 2 = input rejected before running; 124 = timed out; 126 = disabled by config or permission denied; 127 = binary not found |