Skip to main content
Glama

find_free_port

Read-onlyIdempotent

Find free local ports by binding them, optionally within a range, so you can start a server on another port instead of stopping the process holding one.

Instructions

Find ports that are free right now, verified by binding them, optionally within a range (e.g. 3000-3999). Use it to start a server on another port instead of stopping what holds one.

Input Schema

NameRequiredDescriptionDefault
countNohow many free ports (default 1)
rangeNowhere to look, e.g. 3000-3999 (default: from 1024 up)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare readOnly, idempotent, non-destructive and closed-world, so the safety profile is covered elsewhere. The description adds genuinely new behavioural context that annotations cannot express: results are verified by actually binding the port, which explains trustworthiness and hints at the momentary side effect of the check.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two tight sentences, zero filler, and the core capability plus its verification guarantee are front-loaded before the usage hint. Nothing is repeated needlessly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a two-optional-parameter read tool with full schema coverage and clear annotations, the description covers what it does, how it verifies, and when to reach for it. The only omission is any indication of the return shape (a list of port numbers, presumably) since no output schema exists, which would be a small but useful addition.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so both parameters and their defaults (count=1, range from 1024 up) are already documented in the schema. The description's '(e.g. 3000-3999)' restates the schema's own example and adds no new syntax, validation or edge-case meaning, so the baseline 3 applies.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource ('find ports that are free right now') plus the verification method ('verified by binding them'), which makes the result meaningful. It implicitly separates itself from check_port (one known port) and list_ports (enumeration), but never names a sibling explicitly, so it stops short of a 5.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

"Use it to start a server on another port instead of stopping what holds one" gives a concrete scenario and implicitly frames the alternative behaviour (stop_process) it is meant to replace. There are no explicit when-not conditions or rate/permission caveats, but the primary use case is unambiguous.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.