get_newest_cves
Retrieve recently published vulnerabilities from the CVE database to identify potential security threats and prioritize patching efforts.
Instructions
Get the newest vulnerabilities from the CVE database
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Maximum number of results to return (default: 10) |
Implementation Reference
- src/index.ts:1926-1946 (handler)MCP CallToolRequestSchema handler case for 'get_newest_cves' tool. Parses optional 'limit' parameter, invokes CVEDBClient.getNewestCves(), formats and returns JSON response, handles errors.case "get_newest_cves": { const limit = request.params.arguments?.limit ? Number(request.params.arguments.limit) : 10; try { const newestCves = await cvedbClient.getNewestCves(limit); return { content: [{ type: "text", text: JSON.stringify(newestCves, null, 2) }] }; } catch (error) { if (error instanceof McpError) { throw error; } throw new McpError( ErrorCode.InternalError, `Error getting newest CVEs: ${(error as Error).message}` ); } }
- src/index.ts:748-763 (helper)Core implementation in CVEDBClient class: makes HTTP GET request to 'https://cvedb.shodan.io/cves?limit=N' to fetch newest CVEs, returns response data, handles API errors.async getNewestCves(limit: number = 10): Promise<any> { try { const response = await this.axiosInstance.get("/cves", { params: { limit } }); return response.data; } catch (error: unknown) { if (axios.isAxiosError(error)) { throw new McpError( ErrorCode.InternalError, `CVEDB API error: ${error.response?.data?.error || error.message}` ); } throw error; } }
- src/index.ts:1240-1251 (registration)Tool registration entry in ListToolsRequestSchema response array defining name, description, and input schema for 'get_newest_cves'.name: "get_newest_cves", description: "Get the newest vulnerabilities from the CVE database", inputSchema: { type: "object", properties: { limit: { type: "number", description: "Maximum number of results to return (default: 10)" } } } },
- src/index.ts:1242-1250 (schema)Input schema definition for 'get_newest_cves' tool: optional 'limit' number parameter.inputSchema: { type: "object", properties: { limit: { type: "number", description: "Maximum number of results to return (default: 10)" } } }