Skip to main content
Glama

query_for_cve_fix_versions

Query the OSV database to retrieve fix versions for a specific CVE ID, helping developers identify secure software updates.

Instructions

Query the OSV database for a CVE and return the fix versions. Args: cve: The CVE ID to query Returns: A list of fix versions

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cveYes

Implementation Reference

  • MCP tool handler for 'query_for_cve_fix_versions'. Decorated with @mcp.tool(), it instantiates OSVServer and calls its query_for_cve_fix_versions method to execute the tool logic.
    @mcp.tool() def query_for_cve_fix_versions(cve: str): """ Query the OSV database for a CVE and return the fix versions. Args: cve: The CVE ID to query Returns: A list of fix versions """ osv = OSVServer() return osv.query_for_cve_fix_versions(cve)
  • Core implementation in OSVServer class: queries CVE details via _query_cve and extracts fix versions via _parse_fix_versions.
    def query_for_cve_fix_versions(self, cve: str): """ Query the OSV database for a CVE and return the fix versions. """ data = self._query_cve(cve) versions = self._parse_fix_versions(data) return versions
  • Helper function to parse and deduplicate fix version strings from the OSV API response.
    def _parse_fix_versions(self, data: dict): """ Parse fix version strings from the OSV response. Extracts fix versions from the 'ranges[].events[].fixed' in the affected package data. Args: data: The full OSV response JSON data Returns: List of fixed version strings """ fix_versions = [] if 'affected' in data: for affected in data['affected']: if 'ranges' in affected: for range_data in affected['ranges']: if 'events' in range_data: for event in range_data['events']: if 'fixed' in event: fix_versions.append(event['fixed']) return list(set(fix_versions)) # Remove duplicates
  • Helper function to fetch CVE details from OSV API endpoint.
    def _query_cve(self, cve: str): """ Query the OSV database for a CVE. """ url = self.cve_url.format(cve_id=cve) response = requests.get(url) return response.json()

Other Tools

Related 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/EdenYavin/OSV-MCP'

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