search_products
Find art supplies by name, category, or supplier to get detailed product information for inventory management and customer service.
Instructions
Search for products by name, category, or supplier. Returns detailed product information.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| filterBy | No | Optional: category, supplier, or price_range | |
| query | Yes | Search term |
Implementation Reference
- src/index.ts:632-649 (handler)Executes the search_products tool by filtering the mock inventory data based on the query parameter and formatting a response with matching products including SKU, price, category, stock, and supplier.case 'search_products': { const query = String(args?.query || '').toLowerCase(); const filterBy = args?.filterBy ? String(args.filterBy) : null; let results = storeData.inventory.filter(item => item.name.toLowerCase().includes(query) || item.category.toLowerCase().includes(query) ); return { content: [{ type: 'text', text: `Found ${results.length} product(s):\n\n${results.map(item => `📦 ${item.name}\n- SKU: ${item.id} | Price: $${item.price}\n- Category: ${item.category} | Stock: ${item.quantity}\n- Supplier: ${item.supplier}` ).join('\n\n')}` }] }; }
- src/index.ts:102-113 (schema)Defines the input schema for the search_products tool, specifying a required 'query' string and optional 'filterBy' parameter.{ name: 'search_products', description: 'Search for products by name, category, or supplier. Returns detailed product information.', inputSchema: { type: 'object', properties: { query: { type: 'string', description: 'Search term' }, filterBy: { type: 'string', description: 'Optional: category, supplier, or price_range' }, }, required: ['query'], }, },
- src/index.ts:516-518 (registration)Registers the listTools handler which returns the array of all tools including search_products.server.setRequestHandler(ListToolsRequestSchema, async () => { return { tools }; });
- src/dashboard.ts:38-38 (registration)Mock registration of search_products tool in the dashboard's toolsData for UI display.{ name: 'search_products', description: 'Search product catalog', category: 'Inventory Management' },