get_vulnerability_details
Retrieve comprehensive details about a specific vulnerability by providing its unique ID, such as CVE identifiers, using the Nessus MCP Server for advanced security insights.
Instructions
Get detailed information about a specific vulnerability
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| vulnerability_id | Yes | ID of the vulnerability (e.g., CVE-2021-44228) |
Implementation Reference
- src/tools/vulnerabilities.ts:29-73 (handler)The primary handler function that executes the get_vulnerability_details tool logic, including input validation, API call to fetch details, formatting, and error handling.export const getVulnerabilityDetailsToolHandler = async (args: Record<string, unknown>) => { try { // Validate arguments const vulnId = validateVulnerabilityId(args.vulnerability_id); // Get vulnerability details const details = await getVulnerabilityDetails(vulnId); // Check if there was an error if ('error' in details) { return { content: [ { type: 'text', text: `Error: ${details.error}` } ], isError: true }; } // Format the vulnerability details const formattedDetails = formatVulnerabilityDetails(details); return { content: [ { type: 'text', text: formattedDetails } ] }; } catch (error) { const mcpError = handleNessusApiError(error); return { content: [ { type: 'text', text: `Error: ${mcpError.message}` } ], isError: true }; } };
- src/tools/vulnerabilities.ts:14-27 (schema)Defines the input schema and metadata for the get_vulnerability_details tool.export const getVulnerabilityDetailsToolSchema = { name: 'get_vulnerability_details', description: 'Get detailed information about a specific vulnerability', inputSchema: { type: 'object', properties: { vulnerability_id: { type: 'string', description: 'ID of the vulnerability (e.g., CVE-2021-44228)' } }, required: ['vulnerability_id'] } };
- src/index.ts:107-108 (registration)Registers and dispatches the get_vulnerability_details tool handler in the main CallToolRequestSchema switch statement.case 'get_vulnerability_details': return await getVulnerabilityDetailsToolHandler(args);
- src/index.ts:71-86 (registration)Registers the tool schema in the ListToolsRequestSchema handler, making it discoverable.server.setRequestHandler( ListToolsRequestSchema, async () => { return { tools: [ listScanTemplatesToolSchema, startScanToolSchema, getScanStatusToolSchema, getScanResultsToolSchema, listScansToolSchema, getVulnerabilityDetailsToolSchema, searchVulnerabilitiesToolSchema ] }; } );
- src/nessus-api.ts:131-138 (helper)Supporting function called by the handler to retrieve raw vulnerability details from mock data or real Nessus API.export const getVulnerabilityDetails = async (vulnId: string) => { if (config.useMock) { return getMockVulnerabilityDetails(vulnId); } // Real API implementation would go here throw new Error("Real API not implemented"); };