Skip to main content
Glama

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
NameRequiredDescriptionDefault
filterByNoOptional: category, supplier, or price_range
queryYesSearch term

Implementation Reference

  • 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')}` }] }; }
  • 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' },

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/wspotter/mcpart'

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