Skip to main content
Glama

Get Free Port

get_free_port

Find an available TCP/UDP port within a specified range to avoid binding conflicts when starting local services.

Instructions

返回指定范围内任意一个空闲端口。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
familyNo
end_portNo
protocolNo
start_portNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

C2.6/5.0
Behavior2/5

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

No annotations are provided, so the description carries the full behavioral burden. It says a free port is returned, but does not explain whether the port is reserved, how availability is checked, whether race conditions are possible, or how family and protocol affect the result.

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

Conciseness4/5

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

The description is a single front-loaded sentence with no wasted words. It is appropriately concise, though its brevity contributes to the broader completeness gaps.

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

Completeness2/5

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

An output schema exists, so return values need not be explained. However, with no annotations and 0% parameter coverage, the description leaves family/protocol semantics and port-checking behavior undocumented for a four-parameter tool.

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

Parameters1/5

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

There are four parameters with 0% schema description coverage, and the description only vaguely refers to a 'specified range.' It does not mention family, protocol, start_port, end_port, defaults, or accepted values.

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: it returns an idle port within a specified range. The singular scope ('任意一个' / any one) helps distinguish it from the sibling get_free_ports, but no alternative is explicitly named.

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

Usage Guidelines2/5

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

There is no guidance on when to use this tool versus alternatives such as find_port, get_free_ports, or is_port_used. The range requirement is implied, but no conditions or exclusions are given.

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