get_product_by_model
Retrieve detailed product specifications, pricing, and availability by inputting the exact model number, ensuring precise information for accurate decision-making.
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 executes the tool logic: searches through all loaded product categories, subcategories, and products to find an exact case-insensitive match on the model field, returns detailed product info including price, specs, category context, or 'not found' if no match.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)Input schema definition for the tool, specifying a required 'model' string parameter with description.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)Tool registration object returned by ListToolsRequest handler, including name, description, and input schema.{ 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)Dispatcher switch case in CallToolRequest handler that routes calls to the getProductByModel handler method.case "get_product_by_model": return this.getProductByModel(args);