Skip to main content
Glama

search_products

Search computer components by keyword, category, or price range to find products for building custom PCs. Use for broad searches when component type is uncertain.

Instructions

General search across all computer components. Use this for broad searches or when component type is uncertain. For specific components, use dedicated search tools (search_cpu, search_gpu, etc.)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
keywordYesSearch keyword - can be brand name (Intel, AMD, NVIDIA), model number, or specifications. Examples: 'Intel', 'RTX', '32GB', 'B650'
categoryNoFilter by product category. Examples: 'CPU', 'GPU', 'RAM', 'SSD', 'MB' (motherboard). Leave empty to search all categories
min_priceNoMinimum price in TWD. Example: 5000 for products above NT$5,000
max_priceNoMaximum price in TWD. Example: 20000 for products under NT$20,000
limitNoMaximum number of results to return. Valid range: 1-100, default: 10

Implementation Reference

  • The core handler function for the 'search_products' tool. It destructures input arguments, iterates through all product categories and subcategories, matches products based on keyword in brand/model/specs/raw_text, applies price filters if provided, limits results, and returns a JSON-formatted response with matching products.
    private searchProducts(args: any) { const { keyword, category, min_price, max_price, limit = 10 } = args; const results: any[] = []; for (const cat of this.productData) { if (category && !cat.category_name.toLowerCase().includes(category.toLowerCase())) { continue; } for (const subcat of cat.subcategories) { for (const product of subcat.products) { const searchText = `${product.brand} ${product.model} ${product.specs.join(" ")} ${product.raw_text}`.toLowerCase(); if (!searchText.includes(keyword.toLowerCase())) { continue; } if (min_price && product.price < min_price) { continue; } if (max_price && product.price > max_price) { continue; } results.push({ ...product, category_name: cat.category_name, subcategory_name: subcat.name, }); if (results.length >= limit) { break; } } if (results.length >= limit) { break; } } if (results.length >= limit) { break; } } return { content: [ { type: "text", text: JSON.stringify({ total_found: results.length, results: results.map(p => ({ brand: p.brand, model: p.model, specs: p.specs, price: p.price, original_price: p.original_price, discount_amount: p.discount_amount, category: p.category_name, subcategory: p.subcategory_name, markers: p.markers, })), }, null, 2), }, ], }; }
  • Input schema defining the parameters for the search_products tool: keyword (required), optional category filter, price range (min_price, max_price), and result limit.
    inputSchema: { type: "object", properties: { keyword: { type: "string", description: "Search keyword - can be brand name (Intel, AMD, NVIDIA), model number, or specifications. Examples: 'Intel', 'RTX', '32GB', 'B650'", }, category: { type: "string", description: "Filter by product category. Examples: 'CPU', 'GPU', 'RAM', 'SSD', 'MB' (motherboard). Leave empty to search all categories", }, min_price: { type: "number", description: "Minimum price in TWD. Example: 5000 for products above NT$5,000", }, max_price: { type: "number", description: "Maximum price in TWD. Example: 20000 for products under NT$20,000", }, limit: { type: "number", description: "Maximum number of results to return. Valid range: 1-100, default: 10", }, }, required: ["keyword"], },
  • src/index.ts:85-114 (registration)
    Registration of the search_products tool in the ListToolsRequestSchema handler, providing the tool name, description, and input schema.
    { name: "search_products", description: "General search across all computer components. Use this for broad searches or when component type is uncertain. For specific components, use dedicated search tools (search_cpu, search_gpu, etc.)", inputSchema: { type: "object", properties: { keyword: { type: "string", description: "Search keyword - can be brand name (Intel, AMD, NVIDIA), model number, or specifications. Examples: 'Intel', 'RTX', '32GB', 'B650'", }, category: { type: "string", description: "Filter by product category. Examples: 'CPU', 'GPU', 'RAM', 'SSD', 'MB' (motherboard). Leave empty to search all categories", }, min_price: { type: "number", description: "Minimum price in TWD. Example: 5000 for products above NT$5,000", }, max_price: { type: "number", description: "Maximum price in TWD. Example: 20000 for products under NT$20,000", }, limit: { type: "number", description: "Maximum number of results to return. Valid range: 1-100, default: 10", }, }, required: ["keyword"], }, },

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/shyuan/coolpc-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server