check_version
Check end-of-life status and support information for software versions to determine security status and upgrade needs.
Instructions
Check EOL status and support information for software versions
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"product": "<product>"
},
"name": "check_version"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| product | Yes | Software product name (e.g., python, nodejs, ubuntu) | |
| version | No | Specific version to check (e.g., 3.8, 16, 20.04) |
Implementation Reference
- src/index.ts:610-661 (handler)The main handler function that executes the 'check_version' tool: validates input, fetches EOL cycle data from endoflife.date API for the given product/version, caches the query, and returns the relevant cycle information as JSON.
private async handleCheckVersion(args: CheckVersionArgs) { const { product, version } = args; // Validate product exists if (!this.availableProducts.includes(product)) { return { content: [{ type: "text", text: `Invalid product: ${product}. Use list_products tool to see available products.` }], isError: true }; } try { const response = await this.axiosInstance.get(`/${product}.json`); const cycles = response.data as EOLCycle[]; const filteredCycles = version ? cycles.filter(cycle => cycle.cycle.startsWith(version)) : cycles; this.recentQueries.unshift({ product, version, response: filteredCycles, timestamp: new Date().toISOString() }); if (this.recentQueries.length > API_CONFIG.MAX_CACHED_QUERIES) { this.recentQueries.pop(); } return { content: [{ type: "text", text: JSON.stringify(filteredCycles, null, 2) }] }; } catch (error) { if (axios.isAxiosError(error)) { return { content: [{ type: "text", text: `EOL API error: ${error.response?.data?.message ?? error.message}` }], isError: true }; } throw error; } } - src/types.ts:19-37 (schema)TypeScript interface defining the input arguments for 'check_version' tool and the type guard function to validate them.
export interface CheckVersionArgs { product: string; version?: string; } export interface ListProductsArgs { filter?: string; } // Type guards export function isValidCheckVersionArgs(args: any): args is CheckVersionArgs { return ( typeof args === "object" && args !== null && "product" in args && typeof args.product === "string" && (args.version === undefined || typeof args.version === "string") ); } - src/index.ts:285-302 (registration)Registration of the 'check_version' tool in the ListToolsRequestSchema handler, including name, description, and JSON schema matching CheckVersionArgs.
name: "check_version", description: "Check EOL status and support information for software versions", inputSchema: { type: "object", properties: { product: { type: "string", description: "Software product name (e.g., python, nodejs, ubuntu)", examples: ["python", "nodejs", "ubuntu"] }, version: { type: "string", description: "Specific version to check (e.g., 3.8, 16, 20.04)", examples: ["3.8", "16", "20.04"] } }, required: ["product"] } - src/index.ts:389-396 (handler)Dispatch handler in CallToolRequestSchema that validates arguments using isValidCheckVersionArgs and delegates to the main handleCheckVersion function.
case "check_version": if (!isValidCheckVersionArgs(args)) { throw new McpError( ErrorCode.InvalidParams, "Invalid version check arguments" ); } return this.handleCheckVersion(args);