Skip to main content
Glama

check_port_reachable

Test TCP connectivity to a host and port, reporting whether it is reachable or unreachable along with the reason, such as connection refused, timeout, or DNS failure.

Instructions

Try a TCP connect to host:port and report REACHABLE or UNREACHABLE with the reason.

Distinguishes "connection refused" (host is up, nothing listening), "timed out" (firewall drop or host down) and DNS failures. Works for localhost and remote hosts alike. It only connects and disconnects; no data is sent. Timeout is in seconds (0.1 to 30).

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "host": "<host>",
      "port": "<port>"
    },
    "name": "check_port_reachable"
  }
}

Input Schema

NameRequiredDescriptionDefault
hostYes
portYes
timeoutNo

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.8/5.0
Behavior4/5

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

With no annotations, the description carries the safety burden and does so well: it discloses that only a connect/disconnect occurs, no data is sent, and it quantifies the failure modes returned. It stops short of stating permission requirements, retry behavior, or whether hostnames are resolved per attempt, leaving minor gaps.

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?

Front-loaded with the action and result vocabulary, then layered with diagnostic detail. Every sentence is informative, though 'Works for localhost and remote hosts alike' is close to filler since it is true of any TCP connect.

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?

An output schema exists, so return values need not be spelled out, and the description still previews the REACHABLE/UNREACHABLE vocabulary and failure taxonomy. For a low-risk read-only probe with three simple parameters, the coverage is sufficient; only hostname/IPv6 formatting and auth/permission context are absent.

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

Parameters4/5

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

Schema description coverage is 0%, so the description must compensate and largely does: timeout is documented as seconds with an explicit 0.1–30 range, and host:port framing establishes the meaning and pairing of the two required parameters. Host formatting expectations (IP vs hostname, IPv6) are left unstated.

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 ('Try a TCP connect to host:port') and names the exact outputs (REACHABLE/UNREACHABLE plus reason). It does not name or contrast with the closest siblings (whats_on_port, find_free_port), so an agent must infer the boundary from 'only connects and disconnects; no data is sent'.

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?

Usage is implied rather than stated: the diagnostic breakdown of refused vs timed out vs DNS tells an agent this is for reachability triage, and 'works for localhost and remote hosts alike' broadens scope. There is no explicit when-not guidance or named alternative such as whats_on_port for identifying what is listening.

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