Skip to main content
Glama

Local Nmap

local_nmap

Scans a target host or CIDR block for open TCP ports using nmap's connect scan, without requiring admin privileges. Reports only open ports; supports custom port ranges.

Instructions

Run an nmap TCP connect scan on a target.

Uses TCP connect scan (-sT, no admin needed) with host discovery skipped (-Pn) and reports only open ports. SYN scans and OS detection require root and are not used. Nmap must be installed separately.

Targets are limited to one host or a CIDR block of at most 256 addresses (/24 for IPv4, /120 for IPv6): with -Pn nmap probes every address in the block, so a larger prefix would exhaust the 120 s time budget without finishing. nmap's octet-range (10.0.0-255.1), wildcard and comma-list target syntax is rejected for the same reason; scan several small blocks instead. Rejected inputs are reported in the result's error field.

Disabled by default (it can scan arbitrary internal hosts from this machine). Enable via allow_active_tools in config.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
portsNoPort spec: comma-separated ports and/or ranges, e.g. '22,80,443' or '1-1024'. Default scans nmap's top 1000 ports.
targetYesOne IP address, one hostname, or a CIDR block of at most /24 (IPv4) or /120 (IPv6)

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
noteNoAdditional context about the result
errorNoWhy the tool could not produce a result: input validation failure, tool disabled by configuration, binary not installed, or no service answered. Empty when the command executed.
stderrYesStandard error of the command, or the failure message when the command did not run
stdoutYesStandard output of the command (curl output is capped at 10,000 characters)
commandYesThe exact command line that was executed, or the tool name if the command never ran
successYesTrue when the command ran and exited with status 0
platformYesOperating system the command ran on (Darwin, Linux or Windows)
returncodeYesProcess exit status. 0 = success; 2 = input rejected before running; 124 = timed out; 126 = disabled by config or permission denied; 127 = binary not found

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.7/5.0
Behavior5/5

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

With no annotations provided, the description carries the full burden and does so thoroughly. It discloses the scan method, privileges not required, target size limits, timeout rationale, rejected syntaxes, error reporting behavior, the separate installation requirement, and the default-disabled security posture.

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 longer than average, but every sentence delivers decision-relevant information such as constraints, error handling, installation, and enablement. It is organized in short logical blocks and contains no filler, making the length justified.

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?

Given an output schema exists and only two parameters, the description covers everything an agent needs to invoke the tool correctly: what it does, how it behaves, constraints, failure modes, prerequisites, and configuration. Nothing essential is missing.

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 the schema already documents both parameters, but the description adds meaningful semantics beyond it: target restrictions are tied to the 120 s time budget, rejected target syntaxes are enumerated, and the default ports behavior is clarified. This goes beyond simply restating parameter names.

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 action ('Run an nmap TCP connect scan') on a clear resource ('a target') with the scan technique named. It distinguishes itself from scanning variants by explicitly noting it uses -sT, not SYN scans or OS detection, so an agent can tell it apart from similar network 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?

Gives clear context: TCP connect scan needs no admin, host discovery is skipped, and only open ports are reported. It also states exclusions (no SYN scans, no OS detection, no large CIDR blocks) and notes it is disabled by default and must be enabled via config, but it does not name sibling alternatives to choose instead.

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