get_cve_details
Retrieve detailed CVE information including severity, CVSS score, description, and references by providing a CVE identifier.
Instructions
Get detailed information about a specific CVE by its ID. Returns severity, CVSS score, description, and references.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cve_id | Yes | The CVE identifier (e.g., 'CVE-2024-0001') |
Implementation Reference
- src/mcp_server/tools.py:19-38 (handler)The core handler function for the 'get_cve_details' tool. Normalizes the CVE ID, retrieves the CVE data from the database using get_cve, parses and cleans up references from JSON, and returns formatted JSON response or error if not found.def tool_get_cve_details(cve_id: str) -> str: conn = get_connection() cve_id = cve_id.strip().upper() if not cve_id.startswith("CVE-"): cve_id = "CVE-{}".format(cve_id) result = get_cve(conn, cve_id) if result: if result.get('references_json'): try: result['references'] = json.loads(result['references_json']) except: result['references'] = [] del result['references_json'] return json.dumps(result, indent=2) return json.dumps({"error": "not found", "cve_id": cve_id})
- src/mcp_server/server.py:21-35 (registration)Tool registration in @app.list_tools(), including name, description, and input schema for 'get_cve_details'.Tool( name="get_cve_details", description="Get detailed information about a specific CVE by its ID. " "Returns severity, CVSS score, description, and references.", inputSchema={ "type": "object", "properties": { "cve_id": { "type": "string", "description": "The CVE identifier (e.g., 'CVE-2024-0001')" } }, "required": ["cve_id"] } ),
- src/mcp_server/server.py:70-71 (registration)Dispatch logic in @app.call_tool() that maps the tool call to the handler function.if name == "get_cve_details": result = tool_get_cve_details(arguments.get("cve_id", ""))
- src/mcp_server/tools.py:12-16 (helper)Helper function to lazily initialize and provide database connection used by the tool handler.def get_connection(): global _conn if _conn is None: _conn = init_db() return _conn
- src/mcp_server/server.py:8-9 (registration)Import of the tool handler functions into the server module.from .tools import ( tool_get_cve_details,