Skip to main content
Glama

find_free_port

Read-only

Locate and lease an unbound, unreserved local port that binds on IPv4 and IPv6, preventing collisions between parallel development servers.

Instructions

Return a port that is not listening, not reserved, and can be bound on IPv4 and IPv6.

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

NameRequiredDescriptionDefault
toNo
fromNo
frameworkNoFramework whose default port is tried first.
preferredNoFirst port to try.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.5/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=true, destructiveHint=false, and openWorldHint=false, so the safety profile is covered. The description does add real behavioral content by defining what "free" means (not listening, not reserved, dual-stack bindable), but omits the critical caveat of whether the returned port is held/reserved for the caller or is a snapshot subject to races, and says nothing about failure when no port is available.

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?

A single front-loaded sentence with zero filler; the verb and the three qualifiers each carry information. Nothing is repeated from the schema or annotations.

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

Completeness3/5

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

With four optional parameters, no output schema, and no required fields, an agent still needs to know the return type (presumably an integer port, but unstated), the behavior when the range is exhausted, and how the search order works across 'preferred', 'framework', and 'from'/'to'. The description gives the guarantee but leaves these operational details unanswered.

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 description coverage is 50%: 'framework' and 'preferred' are documented in the schema, while 'from' and 'to' carry no description anywhere. The description mentions no parameters at all, so it neither compensates for the undocumented range bounds nor clarifies how 'preferred' and 'framework' interact with the scan. Per the coverage rule, the mid-range baseline 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 ("Return a port") and sharpens it with three concrete qualifying conditions: not listening, not reserved, bindable on IPv4 and IPv6. An agent can distinguish this from siblings like reserve_port or get_port_info by the word "return" and the guarantee. It stops short of naming any sibling explicitly, so no differentiation credit beyond the verb.

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

Usage Guidelines3/5

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

There is no explicit when-to-use or when-not-to-use sentence, and no mention of the plausible alternatives suggest_port or reserve_port, which are the closest competing choices. The guarantee of a bindable, unreserved port implicitly signals a stronger contract than a mere suggestion, but the agent must infer that distinction rather than being told.

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