get_product_by_model
Retrieve detailed specifications, pricing, and availability for computer components by entering the exact model number.
Instructions
Get detailed specifications and pricing for a specific product by exact model number. Use when you know the exact product model and need full details including specs, current price, and availability markers.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| model | Yes | Exact product model number (case-insensitive). Examples: 'i5-14400F', 'RTX 4060', 'B650M-PLUS', 'WD_BLACK SN770'. Must match exactly as listed |
Implementation Reference
- src/index.ts:962-1007 (handler)The main handler function that implements the tool logic: extracts the model from args, searches through all product categories, subcategories, and products for an exact case-insensitive model match, and returns the full product details including price, specs, and markers in JSON format, or a 'not found' response.private getProductByModel(args: any) { const { model } = args; for (const cat of this.productData) { for (const subcat of cat.subcategories) { for (const product of subcat.products) { if (product.model.toLowerCase() === model.toLowerCase()) { return { content: [ { type: "text", text: JSON.stringify({ found: true, product: { brand: product.brand, model: product.model, specs: product.specs, price: product.price, original_price: product.original_price, discount_amount: product.discount_amount, category: cat.category_name, subcategory: subcat.name, markers: product.markers, raw_text: product.raw_text, }, }, null, 2), }, ], }; } } } } return { content: [ { type: "text", text: JSON.stringify({ found: false, message: `Product with model "${model}" not found`, }, null, 2), }, ], }; }
- src/index.ts:256-265 (schema)Defines the input schema for the tool: requires a single 'model' string parameter with description of expected format.inputSchema: { type: "object", properties: { model: { type: "string", description: "Exact product model number (case-insensitive). Examples: 'i5-14400F', 'RTX 4060', 'B650M-PLUS', 'WD_BLACK SN770'. Must match exactly as listed", }, }, required: ["model"], },
- src/index.ts:253-266 (registration)Registers the tool in the list_tools response, including name, description, and input schema for client discovery.{ name: "get_product_by_model", description: "Get detailed specifications and pricing for a specific product by exact model number. Use when you know the exact product model and need full details including specs, current price, and availability markers.", inputSchema: { type: "object", properties: { model: { type: "string", description: "Exact product model number (case-insensitive). Examples: 'i5-14400F', 'RTX 4060', 'B650M-PLUS', 'WD_BLACK SN770'. Must match exactly as listed", }, }, required: ["model"], }, },
- src/index.ts:317-318 (registration)Registers the tool handler in the call_tool request switch statement, dispatching to the getProductByModel method.case "get_product_by_model": return this.getProductByModel(args);