Skip to main content
Glama

scan-ports

Discover open ports and services on a target host or network using customizable port scan types and timing options.

Instructions

Scan ports on a target host or network.

Performs a port scan using nmap with the specified parameters. Validates all inputs to prevent command injection.

IMPORTANT: Only scan targets you are authorized to scan.

Returns: ScanResult with discovered hosts, ports, and their states.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
targetYesTarget to scan: IP address (192.168.1.1), hostname (example.com), or CIDR notation (192.168.1.0/24). Max /24 network size.
portsNoPort specification. Examples: "22", "1-1024", "22,80,443", "T:22,80,U:53" for protocol-specific. If omitted, scans nmap default ports.
scan_typeNoScan type: "connect" (TCP connect, no root needed), "syn" (SYN stealth, needs root), "udp" (UDP, needs root), "fin", "xmas", "null", "ack". Default: "connect".connect
timingNoTiming template: "paranoid", "sneaky", "polite", "normal", "aggressive", "insane". Default: "normal".normal
service_detectionNoEnable service/version detection (-sV). Slower but identifies running software.
timeoutNoMaximum scan duration in seconds. Default: 600.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
commandYesThe nmap command that was executed (sanitized)
hostsNoResults per host
scan_statsNoScan statistics
raw_outputNoRaw nmap output text
warningsNoScan warnings
Behavior3/5

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

No annotations are provided, so the description carries full burden. It mentions input validation to prevent command injection and returns a ScanResult, which is transparent. However, it does not disclose potential network disturbance, detection risk, or permission requirements beyond authorization.

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 very concise with three main components: purpose, warning, return value. No superfluous sentences.

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?

With 6 parameters and an output schema, the description covers the core functionality and important usage warning. It is complete for the schema richness, though it could mention alternative tools for context.

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%, and the description does not add meaning beyond what the schema already provides for parameters. Baseline 3 is appropriate.

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 clearly states the action (scan ports) and the resource (target host/network) using nmap. It distinguishes from siblings like detect-os or quick-scan by focusing on port scanning.

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?

Provides an authorization warning but lacks explicit guidance on when to use this tool versus sibling tools like detect-services or quick-scan. The description implies usage for network reconnaissance but does not state exclusions or alternatives.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Vorota-ai/nmap-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server