from typing import Any, Optional from smolagents.tools import Tool import requests class CveTriageTool(Tool): name = "cve_patch_priority" description = "Kevscope by CyberMax: patch-priority verdict for up to 20 CVE IDs from CISA KEV (known exploited), FIRST EPSS exploit probability, CVSS and ransomware use, with the reasons. Free tier, no key; paid keys at https://kevscope-api.cybermax-tools.workers.dev/docs" inputs = {'cves': {'type': 'string', 'description': "Comma-separated CVE IDs, e.g. 'CVE-2024-3400,CVE-2023-4966'"}} output_type = "object" def forward(self, cves: str): import requests r = requests.get("https://kevscope-api.cybermax-tools.workers.dev/api/priority", params={"cve": cves, "via": "smolagents"}, timeout=30) return r.json() def __init__(self, *args, **kwargs): self.is_initialized = False