list_products
Browse or search software products to check end-of-life dates, support status, and security information using real-time data from the endoflife.date API.
Instructions
Browse or search available software products
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "list_products"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| filter | No | Optional search term to filter products |
Implementation Reference
- src/index.ts:663-679 (handler)The main handler function for the list_products tool. It filters the list of available products based on an optional filter argument and returns the JSON stringified list.
private async handleListProducts(args: { filter?: string }) { const { filter } = args; let products = this.availableProducts; if (filter) { products = products.filter(p => p.toLowerCase().includes(filter.toLowerCase()) ); } return { content: [{ type: "text", text: JSON.stringify(products, null, 2) }] }; } - src/types.ts:24-26 (schema)TypeScript interface defining the input arguments for the list_products tool.
export interface ListProductsArgs { filter?: string; } - src/types.ts:39-45 (schema)Type guard function for validating list_products input arguments.
export function isValidListProductsArgs(args: any): args is ListProductsArgs { return ( typeof args === "object" && args !== null && (args.filter === undefined || typeof args.filter === "string") ); } - src/index.ts:329-342 (registration)Tool registration in the listTools handler, defining name, description, and input schema.
{ name: "list_products", description: "Browse or search available software products", inputSchema: { type: "object", properties: { filter: { type: "string", description: "Optional search term to filter products", examples: ["python", "linux", "database"] } } } }, - src/index.ts:407-414 (registration)Dispatch logic in the callTool handler that validates arguments and invokes the list_products handler.
case "list_products": if (!isValidListProductsArgs(args)) { throw new McpError( ErrorCode.InvalidParams, "Invalid list products arguments" ); } return this.handleListProducts(args);