Skip to main content
Glama

wait_for_port

Read-onlyIdempotent

Blocks until a specified port accepts connections to confirm a server or database is ready, or until it is free when free mode is set; returns promptly or fails after the timeout.

Instructions

Wait until a port accepts connections, e.g. until a server or database has finished starting, or with free=true until a port is free again. Returns as soon as it's ready, or fails after timeout_seconds.

Input Schema

NameRequiredDescriptionDefault
freeNowait until the port is free instead of open
hostNohost (default localhost)
portYesthe port to wait for
timeout_secondsNogive up after this many seconds (default 30, at most 300)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.1/5.0
Behavior4/5

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

The annotations already declare readOnlyHint, idempotentHint, openWorldHint=false, and destructiveHint=false, so the safety profile is covered. The description adds useful behavioral detail: it returns as soon as the port is ready and fails after timeout_seconds. It does not describe polling behavior or failure formatting, but that is a minor gap given the annotations.

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?

The description is two tight sentences with no filler. It front-loads the core behavior and then adds the free-port alternative and timeout failure semantics. Every sentence contributes useful information.

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

Completeness5/5

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

For a simple four-parameter tool with full schema coverage and no output schema, the description is complete enough to call correctly. It explains the main mode, the free=true mode, the waiting behavior, and timeout failure. Nothing essential is missing.

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 100%, so all four parameters are already documented in the input schema. The description reinforces the meaning of free=true and timeout_seconds, but adds little beyond what the schema provides and does not mention host. This meets the baseline for fully covered parameters.

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: waiting for a port to accept connections or, with free=true, to become free. It clearly distinguishes the waiting behavior from a simple check, though it does not explicitly name sibling tools such as check_port. The purpose is immediately understandable.

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?

The description gives concrete usage contexts, such as waiting for a server or database to finish starting, and explains the free=true alternative. It also states that the tool fails after timeout_seconds. It does not explicitly compare against check_port or find_free_port, but the intended usage is clear.

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