list-all-scans
Access and review all stored network scan results for analysis and security insights on the Nmap MCP Server, enabling efficient management of network security data.
Instructions
List all available scan results
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Input Schema (JSON Schema)
{
"properties": {},
"type": "object"
}
Implementation Reference
- src/nmap_mcp/server.py:381-404 (handler)The handler logic for the 'list-all-scans' tool. It iterates over stored scan_results, formats a list of scans with ID, target, options, and host count, and returns it as text content. If no scans, returns a 'no scans' message.elif name == "list-all-scans": if not scan_results: return [ types.TextContent( type="text", text="No scans have been performed yet.", ) ] scan_list = [] for scan_id, scan_data in scan_results.items(): hosts_count = len(scan_data.get("hosts", [])) scan_list.append(f"- Scan ID: {scan_id}") scan_list.append(f" Target: {scan_data.get('target')}") scan_list.append(f" Options: {scan_data.get('options')}") scan_list.append(f" Hosts: {hosts_count}") scan_list.append("") return [ types.TextContent( type="text", text="Available scans:\n\n" + "\n".join(scan_list), ) ]
- src/nmap_mcp/server.py:171-179 (registration)Registration of the 'list-all-scans' tool in the handle_list_tools function, including its description and empty input schema (no arguments required).types.Tool( name="list-all-scans", description="List all available scan results", inputSchema={ "type": "object", "properties": {}, }, ) ]
- src/nmap_mcp/server.py:174-179 (schema)Input schema for 'list-all-scans' tool: an empty object, indicating no required arguments.inputSchema={ "type": "object", "properties": {}, }, ) ]