customer_list
List customers with purchase and subscription status. Paginate results by specifying limit and offset to control data volume.
Instructions
List customers from your Iaptic account.
Returns a paginated list of customers with their purchase status
Each customer includes:
Application username
Last purchase information
Subscription status (active/lapsed)
Renewal intent
Trial/introductory period status
Use limit and offset for pagination (default: 100 customers per page)
Results are ordered by creation date (newest first)
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Maximum number of customers to return (default: 100) | |
| offset | No | Number of customers to skip for pagination |
Implementation Reference
- src/tools/customers.ts:205-214 (handler)The _handleTool method processes 'customer_list' by calling this.api.getCustomers(args) and returning the result as JSON content.
private async _handleTool(name: string, args: any) { switch (name) { case 'customer_list': const customers = await this.api.getCustomers(args); return { content: [{ type: "text", text: JSON.stringify(customers, null, 2) }] }; - src/tools/customers.ts:49-62 (schema)Schema definition for 'customer_list' tool: defines input parameters (limit, offset, and optionally appName) and provides the description.
return [ { name: "customer_list", description: `List customers from your Iaptic account. - Returns a paginated list of customers with their purchase status - Each customer includes: - Application username - Last purchase information - Subscription status (active/lapsed) - Renewal intent - Trial/introductory period status - Use limit and offset for pagination (default: 100 customers per page) - Results are ordered by creation date (newest first)${appNameRequired ? '\n- Requires appName parameter when using master key' : ''}`, inputSchema: baseSchema - src/server.ts:85-91 (registration)Tool call routing: The server routes tool calls with name starting with 'customer_' to CustomerTools.handleTool(), which dispatches to 'customer_list'.
this.server.setRequestHandler(CallToolRequestSchema, async (request) => { const { name, arguments: args } = request.params; try { // Route tool calls to appropriate handler if (name.startsWith('customer_')) { return await this.tools.customers.handleTool(name, args); - src/iaptic-api.ts:171-174 (helper)The API helper method getCustomers() called by the handler to fetch customer list from the Iaptic API endpoint /customers.
async getCustomers(params?: { limit?: number; offset?: number; appName?: string }) { const response = await this.client.get('/customers', { params }); return response.data; } - src/server.ts:68-82 (registration)Tool listing registration: The server's ListToolsRequestSchema handler calls CustomerTools.getTools() which returns 'customer_list' among other tools.
private setupHandlers() { // List available tools this.server.setRequestHandler(ListToolsRequestSchema, async () => { return { tools: [ ...this.tools.customers.getTools(), ...this.tools.purchases.getTools(), ...this.tools.transactions.getTools(), ...this.tools.statistics.getTools(), ...this.tools.stripe.getTools(), ...this.tools.events.getTools(), ...this.tools.app.getTools() ] }; });