Skip to main content
Glama

port_scan

Run a TCP connect scan on a single host to identify open ports and their services, with configurable port ranges and timeouts for authorized reconnaissance.

Instructions

TCP connect scan of a single host, reporting open ports and services.

Scoped to a single host with a hard cap of 1024 ports per call — it is recon for one authorized target, not a mass scanner. Only scan hosts you own or have explicit permission to assess.

Args: host: Hostname or IP to scan, e.g. "example.com". ports: Ports to scan as a string: "22,80,443", a range "1-1024", or a mix "1-100,443,8080". Omit to scan a built-in set of common ports. timeout: Per-port connection timeout in seconds.

Returns: A dict with: host, ip, scanned (count), open_count, and open_ports (each with port and service). Returns an error field on bad input or DNS failure.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
hostYes
portsNo
timeoutNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.13.0

TDQS

A4.6/5.0
Behavior4/5

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

With no annotations provided, the description carries the full burden of behavioral transparency. It discloses the scan type (TCP connect), the port cap, the per-port timeout, and error conditions on bad input or DNS failure. It appropriately warns about authorization, but does not detail rate-limiting, timing behavior, or side effects beyond the 1024-port cap.

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 efficiently organized: a one-sentence core definition, a scoping/authorization paragraph, an Args section, and a Returns section. Every sentence adds necessary information, and the most important scoping constraint is front-loaded.

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?

Despite having no annotations and no output schema, the description gives enough context for an agent to invoke the tool correctly: it defines inputs, output structure, error handling, and usage boundaries. Nothing essential for selecting and calling this tool is missing.

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

Parameters5/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 fully compensate. It explains all three parameters in detail: host with an example, ports with explicit formats ('22,80,443', '1-1024', '1-100,443,8080') and its default behavior, and timeout as a per-port connection timeout. This is far more informative than the bare schema.

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?

The description opens with a specific verb-resource pair ('TCP connect scan of a single host') and states the precise output ('open ports and services'). It distinguishes itself from a 'mass scanner', making its scope and purpose unmistakable relative to the sibling recon tools.

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?

It clearly scopes the tool to a single host, notes the 1024-port hard cap, and strongly states the proper use case: 'recon for one authorized target, not a mass scanner'. It also adds the authorization requirement ('only scan hosts you own or have explicit permission to assess'). It does not explicitly name a sibling alternative, but the domain is specific enough that this is a minor omission.

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