Skip to main content
Glama

list_scans

Retrieve and monitor the status of all scans using the Nessus MCP Server. Simplify scan management by accessing a comprehensive list of active and completed scans.

Instructions

List all scans and their status

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function for the 'list_scans' tool. It fetches the list of scans using listScans() and returns them as JSON in the MCP response format, handling errors appropriately.
    export const listScansToolHandler = async () => { try { // Get all scans const scans = await listScans(); return { content: [ { type: 'text', text: JSON.stringify(scans, null, 2) } ] }; } catch (error) { const mcpError = handleNessusApiError(error); return { content: [ { type: 'text', text: `Error: ${mcpError.message}` } ], isError: true }; } };
  • The schema definition for the 'list_scans' tool, specifying its name, description, and empty input schema since it takes no parameters.
    export const listScansToolSchema = { name: 'list_scans', description: 'List all scans and their status', inputSchema: { type: 'object', properties: {} } };
  • src/index.ts:105-106 (registration)
    Registration of the 'list_scans' tool handler in the main tool call switch statement in the MCP server's CallToolRequestHandler.
    case 'list_scans': return await listScansToolHandler();
  • src/index.ts:75-83 (registration)
    Registration of the 'list_scans' tool schema (line 80) in the ListToolsRequestHandler response array.
    tools: [ listScanTemplatesToolSchema, startScanToolSchema, getScanStatusToolSchema, getScanResultsToolSchema, listScansToolSchema, getVulnerabilityDetailsToolSchema, searchVulnerabilitiesToolSchema ]
  • Helper function listScans() that provides the actual logic to list scans, using mock data or throwing for real API.
    export const listScans = async () => { if (config.useMock) { const scans = Array.from(mockScans.values()).map(scan => ({ id: scan.id, target: scan.target, type: scan.type, status: scan.status, created: scan.created })); return { scans }; } // Real API implementation would go here throw new Error("Real API not implemented"); };

Other Tools

Related 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/Cyreslab-AI/nessus-mcp-server'

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