Skip to main content
Glama
imjdl

Nmap MCP Server

get-scan-details

Retrieve detailed results from a specific Nmap network scan to analyze findings and assess security posture.

Instructions

Get detailed information about a specific scan

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
scan_idYesID of the scan to retrieve

Implementation Reference

  • Handler for the 'get-scan-details' tool. Retrieves the scan data by ID, computes summary stats like hosts up and total ports, and returns a formatted text summary pointing to the full resource.
    elif name == "get-scan-details":
        scan_id = arguments.get("scan_id")
        
        if not scan_id:
            raise ValueError("Missing scan_id")
            
        if scan_id not in scan_results:
            return [
                types.TextContent(
                    type="text",
                    text=f"Scan with ID {scan_id} not found",
                )
            ]
            
        scan_data = scan_results[scan_id]
        
        # Extract summary information
        hosts_up = sum(1 for host in scan_data.get("hosts", []) if host.get("status") == "up")
        total_ports = sum(len(host.get("services", [])) for host in scan_data.get("hosts", []))
        
        return [
            types.TextContent(
                type="text",
                text=f"Scan of {scan_data.get('target')} (ID: {scan_id}):\n"
                     f"- Options: {scan_data.get('options')}\n"
                     f"- Timestamp: {scan_data.get('timestamp')}\n"
                     f"- Hosts: {len(scan_data.get('hosts', []))} ({hosts_up} up)\n"
                     f"- Total ports/services: {total_ports}\n\n"
                     f"Use the nmap://scan/{scan_id} resource to access full results",
            )
        ]
  • Input schema for the 'get-scan-details' tool, defining the required 'scan_id' string parameter.
    inputSchema={
        "type": "object",
        "properties": {
            "scan_id": {"type": "string", "description": "ID of the scan to retrieve"},
        },
        "required": ["scan_id"],
    },
  • Tool registration in the list_tools() response, defining name, description, and input schema for 'get-scan-details'.
    types.Tool(
        name="get-scan-details",
        description="Get detailed information about a specific scan",
        inputSchema={
            "type": "object",
            "properties": {
                "scan_id": {"type": "string", "description": "ID of the scan to retrieve"},
            },
            "required": ["scan_id"],
        },
    ),
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 tool retrieves information, implying a read-only operation, but lacks details on permissions, rate limits, error handling, or what 'detailed information' includes (e.g., format, fields). This is inadequate for a tool with zero annotation coverage.

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 that directly states the tool's purpose without unnecessary words. It is front-loaded with the core action and resource, making it easy to parse quickly.

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 lack of annotations and output schema, the description is incomplete. It doesn't explain what 'detailed information' entails (e.g., scan results, status, metadata), leaving the agent uncertain about the return values. For a tool with no structured output documentation, this gap is significant.

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?

The schema description coverage is 100%, with the single parameter 'scan_id' well-documented in the schema. The description adds no additional meaning beyond implying retrieval of a 'specific scan', which aligns with the schema but doesn't provide extra context like ID format or examples. This meets the baseline for high schema coverage.

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 ('Get detailed information') and resource ('about a specific scan'), making the purpose immediately understandable. It distinguishes from the sibling 'list-all-scans' by focusing on a single scan rather than multiple scans, though it doesn't explicitly differentiate from 'run-nmap-scan' beyond the verb difference.

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 implies usage for retrieving details of a known scan, but it doesn't mention prerequisites (e.g., needing a scan ID from 'list-all-scans') or contrast with siblings like 'run-nmap-scan' for creating scans.

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/imjdl/nmap-mcpserver'

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