Skip to main content
Glama
mohdhaji87

Nmap MCP Server

by mohdhaji87

nmap_comprehensive_scan

Perform a comprehensive network scan using all detection methods to identify open ports, services, operating systems, and vulnerabilities on specified targets.

Instructions

Perform comprehensive scan with all detection methods

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
targetsYes
portsNoall
include_scriptsNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The async handler function implementing the nmap_comprehensive_scan tool logic, performing SYN scan, service version detection, OS detection, optional default scripts, with extended timeout.
    async def nmap_comprehensive_scan(
        targets: str,
        ports: str = "all",
        include_scripts: bool = True
    ) -> str:
        """Perform comprehensive scan with all detection methods."""
        args = ["-sS", "-sV", "-O", "-p", ports]
        
        if include_scripts:
            args.append("--script=default")
        
        args.append(targets)
        
        result = run_nmap_command(args, timeout=600)  # Longer timeout for comprehensive scan
        
        if result["success"]:
            return f"Comprehensive scan completed:\n\n{result['stdout']}"
        else:
            return f"Comprehensive scan failed:\n\n{result['stderr']}"
  • server.py:197-200 (registration)
    The @app.tool decorator registering the nmap_comprehensive_scan tool with its name and description.
    @app.tool(
        name="nmap_comprehensive_scan",
        description="Perform comprehensive scan with all detection methods"
    )
  • Input schema defined by function parameters with type hints: targets (str), ports (str, default 'all'), include_scripts (bool, default True), output str.
    async def nmap_comprehensive_scan(
        targets: str,
        ports: str = "all",
        include_scripts: bool = True
    ) -> str:
Behavior2/5

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

With no annotations provided, the description carries full burden but offers minimal behavioral insight. It mentions 'comprehensive scan' and 'all detection methods', hinting at thoroughness, but doesn't disclose critical traits like potential intrusiveness, network impact, time requirements, or output format. For a scanning tool with zero annotation coverage, this leaves significant gaps in understanding its behavior.

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

Conciseness4/5

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

The description is a single, efficient sentence that gets straight to the point without unnecessary words. It's appropriately sized for a tool name that implies its function, though it could be more informative.

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

Completeness3/5

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

Given the tool's complexity (comprehensive scanning), lack of annotations, and 0% schema coverage, the description is incomplete. However, the presence of an output schema mitigates some need to explain return values. The description provides a basic purpose but fails to address usage, parameters, or behavioral details adequately.

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 but adds no parameter information. It doesn't explain what 'targets', 'ports', or 'include_scripts' mean, their formats, or how they affect the scan. With 3 parameters and no schema descriptions, this is inadequate.

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

Purpose3/5

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

The description states the tool performs a 'comprehensive scan with all detection methods', which indicates a broad scanning operation but lacks specificity about what resources are being scanned. It distinguishes from siblings by implying completeness ('all detection methods'), but doesn't clearly articulate what makes it different from tools like 'nmap_custom_scan' or 'nmap_script_scan' beyond the 'comprehensive' label.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No explicit guidance is provided on when to use this tool versus alternatives. The description mentions 'all detection methods', which might imply it's for thorough scanning, but it doesn't specify scenarios, prerequisites, or exclusions compared to sibling tools like 'nmap_basic_scan' or 'nmap_stealth_scan'.

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/mohdhaji87/Nmap-MCP-Server'

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