check_cve
Scan software products for known security vulnerabilities and check their support status by entering product name and version.
Instructions
Scan for known security vulnerabilities and support status
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| product | Yes | Software product name | |
| version | Yes | Version to check for vulnerabilities | |
| vendor | No | Software vendor (optional) |
Implementation Reference
- src/index.ts:681-724 (handler)The handler function that executes the check_cve tool logic. It fetches EOL cycles for the product, finds the matching version, and returns security status based on support field.private async handleCheckCVE(args: CVECheckArgs) { const { product, version, vendor } = args; try { const response = await this.axiosInstance.get(`/${product}.json`); const cycles = response.data as EOLCycle[]; const matchingCycle = cycles.find(cycle => cycle.cycle.startsWith(version)); if (!matchingCycle) { return { content: [{ type: "text", text: `Version ${version} not found for ${product}` }], isError: true }; } // For now, return basic EOL info since we removed Snyk return { content: [{ type: "text", text: JSON.stringify({ product, version, vendor, cycle: matchingCycle, securityStatus: matchingCycle.support ? 'supported' : 'unsupported' }, null, 2) }] }; } catch (error) { if (axios.isAxiosError(error)) { return { content: [{ type: "text", text: `API error: ${error.response?.data?.message ?? error.message}` }], isError: true }; } throw error; } }
- src/types.ts:91-107 (schema)TypeScript interface and validation function defining the input schema for the check_cve tool.export interface CVECheckArgs { product: string; version: string; vendor?: string; } export function isValidCVECheckArgs(args: any): args is CVECheckArgs { return ( typeof args === "object" && args !== null && "product" in args && typeof args.product === "string" && "version" in args && typeof args.version === "string" && (args.vendor === undefined || typeof args.vendor === "string") ); }
- src/index.ts:304-328 (registration)Tool registration in the ListToolsRequestSchema response, including name, description, and input schema.{ name: "check_cve", description: "Scan for known security vulnerabilities and support status", inputSchema: { type: "object", properties: { product: { type: "string", description: "Software product name", examples: ["python", "nodejs"] }, version: { type: "string", description: "Version to check for vulnerabilities", examples: ["3.8.0", "16.13.0"] }, vendor: { type: "string", description: "Software vendor (optional)", examples: ["canonical", "redhat"] } }, required: ["product", "version"] } },
- src/index.ts:398-405 (registration)Dispatch logic in CallToolRequestSchema handler that validates arguments and calls the check_cve handler.case "check_cve": if (!isValidCVECheckArgs(args)) { throw new McpError( ErrorCode.InvalidParams, "Invalid CVE check arguments" ); } return this.handleCheckCVE(args);