list_customers
Retrieve customer records from Shopmonkey with search by name, email, or phone, and pagination controls for efficient data management.
Instructions
List customers from Shopmonkey. Supports search and pagination.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | No | Search query to filter customers by name, email, or phone | |
| locationId | No | Filter by location ID. Defaults to SHOPMONKEY_LOCATION_ID env var if set. | |
| limit | No | Maximum number of results to return (default: 25) | |
| page | No | Page number for pagination (default: 1) |
Implementation Reference
- src/tools/customers.ts:80-90 (handler)The handler function for the `list_customers` MCP tool, which prepares query parameters and calls the Shopmonkey API.
async list_customers(args) { const params: Record<string, string> = {}; if (args.query !== undefined) params.query = String(args.query); if (args.locationId !== undefined) params.locationId = String(args.locationId); if (args.limit !== undefined) params.limit = String(args.limit); if (args.page !== undefined) params.page = String(args.page); applyDefaultLocation(params); const data = await shopmonkeyRequest<Customer[]>('GET', '/customer', undefined, params); return { content: [{ type: 'text', text: JSON.stringify(data, null, 2) }] }; }, - src/tools/customers.ts:8-20 (schema)The MCP tool definition (schema) for `list_customers`.
{ name: 'list_customers', description: 'List customers from Shopmonkey. Supports search and pagination.', inputSchema: { type: 'object' as const, properties: { query: { type: 'string', description: 'Search query to filter customers by name, email, or phone' }, locationId: { type: 'string', description: 'Filter by location ID. Defaults to SHOPMONKEY_LOCATION_ID env var if set.' }, limit: { type: 'number', description: 'Maximum number of results to return (default: 25)' }, page: { type: 'number', description: 'Page number for pagination (default: 1)' }, }, }, },