get_cve_info
Retrieve comprehensive details about a specific CVE to analyze vulnerabilities and enhance cybersecurity threat intelligence using Shodan API functionality.
Instructions
Get detailed information about a specific CVE
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cve_id | Yes | CVE ID to look up (e.g., 'CVE-2021-44228') |
Implementation Reference
- src/index.ts:1813-1839 (handler)Primary MCP tool handler for 'get_cve_info': validates input cve_id, calls CVEDBClient.getCveInfo, and formats response as JSON text.case "get_cve_info": { const cveId = String(request.params.arguments?.cve_id); if (!cveId) { throw new McpError( ErrorCode.InvalidParams, "CVE ID is required" ); } try { const cveInfo = await cvedbClient.getCveInfo(cveId); return { content: [{ type: "text", text: JSON.stringify(cveInfo, null, 2) }] }; } catch (error) { if (error instanceof McpError) { throw error; } throw new McpError( ErrorCode.InternalError, `Error getting CVE info: ${(error as Error).message}` ); } }
- src/index.ts:653-673 (handler)Core implementation of CVE info retrieval: makes HTTP GET to CVEDB API /cve/{cveId}, handles 404 not found, and propagates other errors.async getCveInfo(cveId: string): Promise<any> { try { const response = await this.axiosInstance.get(`/cve/${cveId}`); return response.data; } catch (error: unknown) { if (axios.isAxiosError(error)) { if (error.response?.status === 404) { return { error: "CVE not found", message: `CVE ${cveId} was not found in the database.`, status: 404 }; } throw new McpError( ErrorCode.InternalError, `CVEDB API error: ${error.response?.data?.error || error.message}` ); } throw error; } }
- src/index.ts:1156-1168 (registration)Tool registration in ListTools handler: defines name, description, and input schema requiring 'cve_id' string.name: "get_cve_info", description: "Get detailed information about a specific CVE", inputSchema: { type: "object", properties: { cve_id: { type: "string", description: "CVE ID to look up (e.g., 'CVE-2021-44228')" } }, required: ["cve_id"] } },
- src/index.ts:813-814 (helper)Instantiates the CVEDBClient instance used by the get_cve_info tool handler.// Create CVEDB client const cvedbClient = new CVEDBClient();
- src/index.ts:644-648 (helper)CVEDBClient constructor: configures Axios client with CVEDB base URL.constructor() { this.axiosInstance = axios.create({ baseURL: "https://cvedb.shodan.io" }); }