Skip to main content
Glama
davidculver

CVE MCP Server

by davidculver

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
NameRequiredDescriptionDefault
cve_idYesThe CVE identifier (e.g., 'CVE-2024-0001')

Implementation Reference

  • 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})
  • 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"]
        }
    ),
  • 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", ""))
  • 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
  • Import of the tool handler functions into the server module.
    from .tools import (
        tool_get_cve_details,
Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/davidculver/cve-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server