Skip to main content
Glama

get_customer_recommendations

Generate personalized art supply recommendations for customers based on their purchase history and preferences to enhance shopping experience and increase sales.

Instructions

Get personalized product recommendations based on customer purchase history and preferences.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
customerIdYesCustomer ID

Implementation Reference

  • Handler function that finds a customer by ID, matches their preferences against inventory items to generate personalized product recommendations, and returns a formatted list of up to 5 suggested products with prices and stock levels.
    case 'get_customer_recommendations': { const customerId = String(args?.customerId || ''); const customer = storeData.customers.find(c => c.id === customerId); if (!customer) { return { content: [{ type: 'text', text: `❌ Customer ${customerId} not found` }] }; } const recommendations = storeData.inventory.filter(item => customer.preferences.some(pref => item.name.toLowerCase().includes(pref.toLowerCase()) || item.category.toLowerCase().includes(pref.toLowerCase()) ) ).slice(0, 5); return { content: [{ type: 'text', text: `🎯 Personalized recommendations for ${customer.name}:\n\nBased on preferences: ${customer.preferences.join(', ')}\n\n${recommendations.map(item => `• ${item.name} - $${item.price}\n ${item.quantity} in stock` ).join('\n')}` }] }; }
  • Tool schema definition including name, description, and input schema requiring a customerId string.
    { name: 'get_customer_recommendations', description: 'Get personalized product recommendations based on customer purchase history and preferences.', inputSchema: { type: 'object', properties: { customerId: { type: 'string', description: 'Customer ID' }, }, required: ['customerId'], }, },
  • src/index.ts:516-518 (registration)
    Registration of the ListToolsRequestSchema handler which returns the full list of tools including get_customer_recommendations via the 'tools' array.
    server.setRequestHandler(ListToolsRequestSchema, async () => { return { tools }; });

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