list_products
Search or browse software products to retrieve detailed information on their lifecycle, security status, and upgrade recommendations using the EOL MCP Server.
Instructions
Browse or search available software products
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| filter | No | Optional search term to filter products |
Input Schema (JSON Schema)
{
"properties": {
"filter": {
"description": "Optional search term to filter products",
"examples": [
"python",
"linux",
"database"
],
"type": "string"
}
},
"type": "object"
}
Implementation Reference
- src/index.ts:663-679 (handler)The core handler function that executes the list_products tool logic: filters and returns available products.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/index.ts:329-342 (registration)Tool registration in the ListToolsRequestSchema 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/types.ts:24-26 (schema)TypeScript interface defining the input arguments for list_products.export interface ListProductsArgs { filter?: string; }
- src/index.ts:407-414 (handler)Dispatch logic in CallToolRequestSchema switch that validates arguments and invokes the main handler.case "list_products": if (!isValidListProductsArgs(args)) { throw new McpError( ErrorCode.InvalidParams, "Invalid list products arguments" ); } return this.handleListProducts(args);
- 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") ); }