Skip to main content
Glama

start_scan

Initiate a vulnerability scan on a target IP or hostname using specified scan types like basic-network-scan, web-app-scan, or compliance-scan to identify security risks.

Instructions

Start a new vulnerability scan against a target

Input Schema

NameRequiredDescriptionDefault
scan_typeYesType of scan to run (basic-network-scan, web-app-scan, compliance-scan)
targetYesTarget IP address or hostname to scan

Input Schema (JSON Schema)

{ "properties": { "scan_type": { "description": "Type of scan to run (basic-network-scan, web-app-scan, compliance-scan)", "type": "string" }, "target": { "description": "Target IP address or hostname to scan", "type": "string" } }, "required": [ "target", "scan_type" ], "type": "object" }

Implementation Reference

  • Main handler function for the 'start_scan' MCP tool. Validates input (target and scan_type), calls the underlying startScan API function, formats the response as MCP content, and handles errors.
    export const startScanToolHandler = async (args: Record<string, unknown>) => { try { // Validate arguments const targetSchema = z.string().min(1); const scanTypeSchema = z.enum(['basic-network-scan', 'web-app-scan', 'compliance-scan']); const target = validateTarget(args.target); const scanType = validateScanType(args.scan_type); // Start the scan const result = await startScan(target, scanType); return { content: [ { type: 'text', text: JSON.stringify(result, null, 2) } ] }; } catch (error) { const mcpError = handleNessusApiError(error); return { content: [ { type: 'text', text: `Error: ${mcpError.message}` } ], isError: true }; } };
  • Schema definition for the 'start_scan' tool, specifying name, description, and input schema with required target and scan_type parameters.
    export const startScanToolSchema = { name: 'start_scan', description: 'Start a new vulnerability scan against a target', inputSchema: { type: 'object', properties: { target: { type: 'string', description: 'Target IP address or hostname to scan' }, scan_type: { type: 'string', description: 'Type of scan to run (basic-network-scan, web-app-scan, compliance-scan)' } }, required: ['target', 'scan_type'] } };
  • src/index.ts:99-100 (registration)
    Registration/dispatch of the 'start_scan' tool handler in the main tool call switch statement.
    case 'start_scan': return await startScanToolHandler(args);
  • src/index.ts:75-83 (registration)
    Registration of the 'start_scan' tool schema in the list of available tools returned by ListToolsRequest.
    tools: [ listScanTemplatesToolSchema, startScanToolSchema, getScanStatusToolSchema, getScanResultsToolSchema, listScansToolSchema, getVulnerabilityDetailsToolSchema, searchVulnerabilitiesToolSchema ]
  • Underlying helper function called by the handler to start the scan. Currently implements mock mode creating a mock scan ID and queuing status.
    export const startScan = async (target: string, scanType: string) => { if (config.useMock) { const scanId = createMockScan(target, scanType); return { scan_id: scanId, status: "queued", message: "Scan queued successfully" }; } // 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