Skip to main content
Glama

check_ports

Test if specific TCP ports accept connections on an authorized host. Use for targeted port connectivity checks, not range sweeps or service fingerprinting.

Instructions

Test whether a short, explicit list of TCP ports accepts connections on a host in scope. Plain connect only: no banner grabbing, no service fingerprinting, no range scanning. Port ranges and full sweeps are NOT available and asking for more ports than the configured maximum is an error, not a truncated scan. Cost: 1 quota unit PER PORT. A 20-port check spends 20 units.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
hostYesHostname or IP in scope.
portsNoExplicit list of TCP ports.
timeout_secondsNoPer-port connect timeout.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
hostYes
limitNo
portsNo
checkedNo
pinned_ipYes
elapsed_msNo
open_portsNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.6/5.0
Behavior5/5

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

With no annotations, the description carries the full burden and does so: it discloses the connect-only behavior, the absence of fingerprinting, the hard-fail (not truncate) behavior when the port count exceeds the configured maximum, and a concrete cost model of 1 quota unit per port with a worked example. This is exactly the kind of operational detail annotations would otherwise supply.

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?

Four tight sentences, front-loaded with the core action and immediately followed by exclusions and cost. No filler; every sentence is load-bearing.

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 described, and the cost, error, and scope constraints are covered. Minor gaps remain: nothing about authorization or what 'in scope' means operationally beyond the host param description and the get_scope sibling.

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 coverage is 100%, so baseline is 3, but the description adds meaning the schema does not: that ports must be an explicit short list (ranges invalid) and that cost scales linearly with list length. The semantics of the default port list and timeout are left to the schema, which is fine.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb+resource+scope: 'Test whether a short, explicit list of TCP ports accepts connections on a host in scope.' It also draws explicit boundaries against neighboring capabilities ('no banner grabbing, no service fingerprinting'), which lets an agent separate it from tls_certificate_info, http_fetch, or a hypothetical sweep tool without opening the schema.

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?

Gives clear when-not guidance: plain connect only, ranges and full sweeps are NOT available, and exceeding the max port count is an error rather than a truncated scan. It does not name an alternative sibling tool for those excluded cases, but the negatives are explicit and unambiguous.

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