Skip to main content
Glama
mohdhaji87

Nmap MCP Server

by mohdhaji87

nmap_service_detection

Identify running services and their versions on network targets to assess security posture and detect vulnerabilities.

Instructions

Perform service and version detection scan

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
targetsYes
portsNocommon
intensityNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • server.py:121-124 (registration)
    Registration of the 'nmap_service_detection' tool using the @app.tool decorator, specifying name and description.
    @app.tool(
        name="nmap_service_detection",
        description="Perform service and version detection scan"
    )
  • Handler function that executes Nmap service and version detection scan by constructing arguments and calling the shared run_nmap_command helper.
    async def nmap_service_detection(
        targets: str,
        ports: str = "common",
        intensity: int = 7
    ) -> str:
        """Perform service and version detection scan."""
        args = ["-sV", f"--version-intensity={intensity}", "-p", ports, targets]
        
        result = run_nmap_command(args)
        
        if result["success"]:
            return f"Service detection scan completed:\n\n{result['stdout']}"
        else:
            return f"Service detection scan failed:\n\n{result['stderr']}"
Behavior2/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 disclosure. It states the action (perform scan) but doesn't mention whether this is read-only or destructive, what permissions are needed, potential network impact, rate limits, or output format. For a network scanning tool, this lack of context is a significant gap.

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 a single, efficient sentence with zero waste. It's appropriately sized and front-loaded, directly stating the tool's purpose without unnecessary elaboration.

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 complexity of a network scanning tool with 3 parameters, 0% schema coverage, and no annotations, the description is incomplete—it lacks behavioral and parameter details. However, the presence of an output schema mitigates some need to explain return values, keeping it from being completely inadequate.

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 for undocumented parameters. It adds no information about the three parameters (targets, ports, intensity), such as what 'targets' should be (IPs, hostnames), what 'common' ports means, or the range/meaning of 'intensity'. This leaves parameters largely unexplained.

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 'Perform service and version detection scan' clearly states the action (perform scan) and purpose (service and version detection), but it's vague about the specific resource (network targets) and doesn't differentiate from sibling tools like 'nmap_port_scan' or 'nmap_script_scan' which might also detect services. It's better than a tautology but lacks specificity.

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?

The description provides no guidance on when to use this tool versus alternatives like 'nmap_port_scan' or 'nmap_comprehensive_scan'. It doesn't mention prerequisites, context, or exclusions, leaving the agent to guess based on the tool name alone.

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