Skip to main content
Glama
Cyreslab-AI

Nessus MCP Server

get_scan_status

Track and monitor the progress of active scans by retrieving their real-time status using the scan ID, ensuring efficient management of vulnerability assessments.

Instructions

Check the status of a running scan

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
scan_idYesID of the scan to check

Implementation Reference

  • The handler function for the 'get_scan_status' tool. It validates the scan_id argument, calls the getScanStatus helper, formats the response as JSON, and handles errors.
    export const getScanStatusToolHandler = async (args: Record<string, unknown>) => {
      try {
        // Validate arguments
        const scanId = validateScanId(args.scan_id);
    
        // Get scan status
        const status = await getScanStatus(scanId);
    
        return {
          content: [
            {
              type: 'text',
              text: JSON.stringify(status, null, 2)
            }
          ]
        };
      } catch (error) {
        const mcpError = handleNessusApiError(error);
        return {
          content: [
            {
              type: 'text',
              text: `Error: ${mcpError.message}`
            }
          ],
          isError: true
        };
      }
    };
  • The schema definition for the 'get_scan_status' tool, specifying the input requirements including the required 'scan_id' parameter.
    export const getScanStatusToolSchema = {
      name: 'get_scan_status',
      description: 'Check the status of a running scan',
      inputSchema: {
        type: 'object',
        properties: {
          scan_id: {
            type: 'string',
            description: 'ID of the scan to check'
          }
        },
        required: ['scan_id']
      }
    };
  • src/index.ts:101-102 (registration)
    The tool is registered in the main CallToolRequestHandler switch statement, dispatching calls to the getScanStatusToolHandler.
    case 'get_scan_status':
      return await getScanStatusToolHandler(args);
  • The core helper function getScanStatus that fetches the scan status, using mock data or throwing for real API (not implemented). Called by the tool handler.
    export const getScanStatus = async (scanId: string) => {
      if (config.useMock) {
        return getMockScanStatus(scanId);
      }
    
      // Real API implementation would go here
      throw new Error("Real API not implemented");
    };
Install Server

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