Skip to main content
Glama

run_nmap_scan

Execute network reconnaissance scans on IP addresses or ranges using Nmap to identify open ports, services, and vulnerabilities for security assessments.

Instructions

run an nmap scan on an ip or ip range (use the right nmap flags based on the first response)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
ipsYes
flagsYes

Implementation Reference

  • The main handler function decorated with @mcp.tool decorator that registers and implements the 'run_nmap_scan' tool. It executes an nmap scan on the provided IPs using the specified flags, prepending default flags '-sV' and '-v', via the run_command utility.
    @mcp.tool(name="run_nmap_scan",description="run an nmap scan on an ip or ip range (use the right nmap flags based on the first response)")
    async def run_nmap_scan(ips:List[str],flags:List[str]):
        return run_command(["nmap","-sV","-v"]+flags+ips)
  • The @mcp.tool decorator registers the 'run_nmap_scan' tool with the MCP server, including its name and description.
    @mcp.tool(name="run_nmap_scan",description="run an nmap scan on an ip or ip range (use the right nmap flags based on the first response)")
Behavior2/5

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

No annotations are provided, so the description carries the full burden. It mentions using flags based on a 'first response', hinting at a multi-step or feedback-driven process, but doesn't disclose critical behavioral traits like whether this is a read-only scan, potential network impact, authentication needs, rate limits, or output format. This leaves significant gaps for a tool that performs network scanning.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is brief and to the point, but the second part 'use the right nmap flags based on the first response' is somewhat vague and could be more clearly integrated. It's front-loaded with the main action, but the overall structure is minimal without wasting words.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity of network scanning, no annotations, no output schema, and low parameter coverage, the description is incomplete. It lacks details on behavior, output, error handling, and security implications, making it inadequate for safe and effective use by an AI agent.

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

Parameters2/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. It mentions 'ips' and 'flags' implicitly, but doesn't explain what these parameters mean beyond the schema's basic types. For example, it doesn't clarify the format of IPs (e.g., CIDR notation) or valid flag values, leaving parameters largely undocumented.

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?

The description clearly states the action ('run an nmap scan') and target ('on an ip or ip range'), which is specific and unambiguous. However, it doesn't distinguish this tool from potential siblings like 'check_module' or 'command_execution' that might also involve scanning or execution, so it doesn't fully differentiate from alternatives.

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?

The description implies usage context with 'use the right nmap flags based on the first response', suggesting iterative or adaptive use, but it doesn't explicitly state when to use this tool versus alternatives like 'check_SMB_signing' or 'certipy_scan' for different scanning purposes. No clear exclusions or prerequisites are provided.

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/YoussefSahnoun/PentestMCP'

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