Skip to main content
Glama

get_statistics

Retrieve database statistics including record count, date range, and last update information from the CVE vulnerability database.

Instructions

Get database stats (count, date range, last update)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function that implements the core logic of the 'get_statistics' tool by getting a database connection, calling the get_stats helper, and returning the statistics as JSON.
    def tool_get_statistics() -> str: conn = get_connection() stats = get_stats(conn) return json.dumps(stats, indent=2)
  • Registration of the 'get_statistics' tool in the MCP server's list_tools method, defining its name, description, and input schema.
    Tool( name="get_statistics", description="Get database stats (count, date range, last update)", inputSchema={ "type": "object", "properties": {}, "required": [] } )
  • Input schema definition for the 'get_statistics' tool, specifying an empty object since no parameters are required.
    inputSchema={ "type": "object", "properties": {}, "required": [] }
  • Helper function that computes database statistics including total CVE count, date range of CVEs, and last update metadata.
    def get_stats(conn: sqlite3.Connection) -> dict: cursor = conn.execute("SELECT COUNT(*) as total FROM cves") total = cursor.fetchone()['total'] cursor = conn.execute("SELECT MIN(published_date) as oldest, MAX(published_date) as newest FROM cves") dates = cursor.fetchone() cursor = conn.execute("SELECT value FROM metadata WHERE key = 'last_update'") last_update_row = cursor.fetchone() last_update = last_update_row['value'] if last_update_row else None return { "total_cves": total, "oldest_cve": dates['oldest'], "newest_cve": dates['newest'], "last_update": last_update }
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