find_free_port
Locate unused TCP ports in a range by checking listening status and OS bind availability, returning the lowest free ports for the specified host and count.
Instructions
Find unused TCP port(s) in start..end (inclusive), lowest first.
A port counts as free only if nothing is listening on it AND the OS lets us bind it on
host, so ports reserved by the OS (Windows excluded ranges) are skipped. count
returns that many ports. Use host "0.0.0.0" to require that the port is free on every
interface.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "find_free_port"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| end | No | ||
| host | No | 127.0.0.1 | |
| count | No | ||
| start | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |