Skip to main content
Glama
sooth
by sooth

Get Free Port

get_free_port

Find an available port for your application by checking OS-level and registry availability. Optionally tests a preferred port, otherwise returns a free port from 1024-49151.

Instructions

Find and return an available port. Checks both the registry and OS-level availability.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
preferred_portNoOptional specific port to check. If not provided or unavailable, searches for any free port in range 1024-49151.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.6/5.0
Behavior3/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It does add a meaningful, non-obvious behavior — the availability check is dual-layered (registry + OS-level) — which earns credit. However, it does not state whether the port is reserved for the caller, whether the check is subject to race conditions, or whether calling this tool has any side effects relative to register_port.

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 sentences with zero filler; the purpose verb is front-loaded in the first sentence and the behavioral detail earns its place in the second. This is the appropriate size for a tool with a single optional parameter and an output schema.

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 simple tool with one optional parameter and an output schema, the description is largely complete: purpose and a key behavioral nuance are covered, and return values are handled by the output schema. The notable gap is the lack of routing context against the sibling tools, which matters because the presence of register_port/unregister_port leaves ambiguity about whether this tool reserves the returned port.

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?

The single parameter preferred_port is fully documented by the schema (100% coverage), including the fallback to range 1024-49151 when unavailable, so the baseline of 3 applies. The description's phrase 'checks both the registry and OS-level availability' loosely informs what 'available' means, but adds no syntax or format detail beyond what the schema already provides.

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?

The description states a specific verb and resource: 'Find and return an available port,' which is unambiguous, and the note about checking 'both the registry and OS-level availability' adds useful scope. However, it does not explicitly differentiate itself from siblings like lookup_by_port or register_port; the distinction is only implicit in the verbs chosen.

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?

The usage scenario (need an available port) is implied by the purpose statement, but there is no explicit guidance on when to prefer this tool over lookup_by_port, register_port, or unregister_port, and no when-not-to-use conditions. The fallback behavior on preferred_port is documented in the schema, but that is parameter documentation, not usage routing.

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