Skip to main content
Glama
wspotter

MCP Art Supply Store

by wspotter

lookup_customer

Find customer details including purchase history, loyalty points, and preferences using name, email, or phone number to support personalized service and business management.

Instructions

Find customer information by name, email, or phone. Returns purchase history, loyalty points, and preferences.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
identifierYesCustomer name, email, or phone number

Implementation Reference

  • Handler implementation for 'lookup_customer' tool. Searches the mock customer database by identifier (name, email, phone, or ID) and returns detailed customer information including contact details, spending, loyalty points, last visit, and preferences.
    case 'lookup_customer': {
      const identifier = String(args?.identifier || '').toLowerCase();
      const customer = storeData.customers.find(c =>
        c.name.toLowerCase().includes(identifier) ||
        c.email.toLowerCase().includes(identifier) ||
        c.phone.includes(identifier) ||
        c.id.toLowerCase() === identifier
      );
      
      if (!customer) {
        return { content: [{ type: 'text', text: `❌ Customer not found: "${args?.identifier}"` }] };
      }
      
      return {
        content: [{
          type: 'text',
          text: `👤 ${customer.name} (${customer.id})\n\n📧 ${customer.email}\n📱 ${customer.phone}\n\n💰 Total Spent: $${customer.totalSpent.toFixed(2)}\n⭐ Loyalty Points: ${customer.loyaltyPoints} (≈ $${(customer.loyaltyPoints / 10).toFixed(2)} credit)\n📅 Last Visit: ${customer.lastVisit}\n🎨 Preferences: ${customer.preferences.join(', ')}`
        }]
      };
    }
  • Tool schema definition for 'lookup_customer', specifying the input schema requiring an 'identifier' string parameter.
    {
      name: 'lookup_customer',
      description: 'Find customer information by name, email, or phone. Returns purchase history, loyalty points, and preferences.',
      inputSchema: {
        type: 'object',
        properties: {
          identifier: { type: 'string', description: 'Customer name, email, or phone number' },
        },
        required: ['identifier'],
      },
    },
  • src/index.ts:516-518 (registration)
    Registration of all tools including 'lookup_customer' via the ListToolsRequestHandler, which returns the complete tools list containing the lookup_customer definition.
    server.setRequestHandler(ListToolsRequestSchema, async () => {
      return { tools };
    });
  • Mock customer database used by the lookup_customer handler to search and retrieve customer data.
    customers: [
      { id: 'CUST001', name: 'Sarah Martinez', email: 'sarah.m@email.com', phone: '555-0101', loyaltyPoints: 450, totalSpent: 1250.45, lastVisit: '2025-10-02', preferences: ['Watercolor', 'Brushes'] },
      { id: 'CUST002', name: 'James Chen', email: 'jchen@email.com', phone: '555-0102', loyaltyPoints: 890, totalSpent: 2340.78, lastVisit: '2025-10-03', preferences: ['Oil Paint', 'Canvas'] },
      { id: 'CUST003', name: 'Emily Rodriguez', email: 'emily.r@email.com', phone: '555-0103', loyaltyPoints: 230, totalSpent: 678.90, lastVisit: '2025-09-28', preferences: ['Drawing', 'Sketching'] },
      { id: 'CUST004', name: 'Michael Foster', email: 'm.foster@email.com', phone: '555-0104', loyaltyPoints: 1200, totalSpent: 3890.50, lastVisit: '2025-10-01', preferences: ['Acrylic', 'Canvas', 'Brushes'] },
    ],
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It mentions the tool 'returns' data, implying a read-only operation, but doesn't specify whether it requires authentication, has rate limits, or how it handles missing customers. For a lookup tool with zero annotation coverage, this leaves significant gaps in understanding its behavior.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely concise—two sentences that efficiently convey the tool's purpose and return values without any wasted words. It's front-loaded with the core functionality, making it easy to grasp quickly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's moderate complexity (single parameter lookup), no annotations, and no output schema, the description is minimally adequate. It covers what the tool does and what it returns, but lacks details on error handling, authentication, or output structure. This leaves room for improvement in providing a complete operational picture.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 100% description coverage, with the parameter 'identifier' clearly documented as 'Customer name, email, or phone number'. The description adds no additional semantic details beyond this, such as formatting examples or validation rules. With high schema coverage, the baseline score of 3 is appropriate as the description doesn't enhance parameter understanding.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'Find customer information' with specific criteria (by name, email, or phone) and mentions what information is returned (purchase history, loyalty points, preferences). It distinguishes itself from sibling tools like 'get_top_customers' or 'get_customer_recommendations' by focusing on individual lookup rather than aggregated data, though it doesn't explicitly name these alternatives.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage when you need to retrieve a specific customer's details using an identifier, but it doesn't provide explicit guidance on when to use this tool versus alternatives like 'get_top_customers' or 'update_loyalty_points'. No exclusions or prerequisites are mentioned, leaving the context somewhat open-ended.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other 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