vul_last_cves
Retrieve JSON data of recent CVEs, including CAPEC, CWE, and CPE details, by specifying the number of entries to fetch.
Instructions
To get a JSON of the last <number> (5 by default) CVEs including CAPEC, CWE and CPE expansions
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| number | No |
Implementation Reference
- main.py:63-69 (handler)The handler function for the 'vul_last_cves' tool. It constructs the API URI for the last N CVEs and calls the get_requests helper to fetch the data from the CVE search API.@mcp.tool() def vul_last_cves(number: int = 5) -> List[Dict[str, Any]]: """ To get a JSON of the last <number> (5 by default) CVEs including CAPEC, CWE and CPE expansions """ uri = f"last/{number}" return get_requests(uri)
- main.py:15-26 (helper)Helper function used by vul_last_cves (and other tools) to make HTTP GET requests to the CVE API, handling errors and returning JSON or error dict.def get_requests(uri: str) -> Dict[str, Any]: """To get a JSON with all the requests""" session = requests.Session() url = f"{BASE_URL}{uri}" try: response = session.get(url, timeout=15) response.raise_for_status() return response.json() except requests.exceptions.RequestException as e: logger.error(f"api request failed: {url} - {str(e)}") return {"error": str(e)}
- main.py:63-63 (registration)The @mcp.tool() decorator registers the vul_last_cves function as an MCP tool.@mcp.tool()