list_orders
Retrieve all orders from a Mailchimp store to track purchases and manage customer transactions.
Instructions
List all orders in a store
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| store_id | Yes | The store ID |
Implementation Reference
- src/tools/index.ts:484-497 (registration)Tool definition and registration in getToolDefinitions, including name, description, and input schema for validation.{ name: "list_orders", description: "List all orders in a store", inputSchema: { type: "object", properties: { store_id: { type: "string", description: "The store ID", }, }, required: ["store_id"], }, },
- src/tools/index.ts:1103-1121 (handler)The handler logic in handleToolCall that processes the tool call, invokes the service, and formats the response as JSON.case "list_orders": const orders = await service.listOrders(args.store_id); return { content: [ { type: "text", text: JSON.stringify( orders.orders.map((o) => ({ id: o.id, order_total: o.order_total, currency_code: o.currency_code, financial_status: o.financial_status, })), null, 2 ), }, ], };
- src/services/mailchimp.ts:329-335 (helper)Helper method in MailchimpService that performs the paginated API request to fetch orders from Mailchimp e-commerce endpoint.async listOrders(storeId: string): Promise<{ orders: MailchimpOrder[] }> { return await this.makePaginatedRequest( `/ecommerce/stores/${storeId}/orders`, "processed_at_foreign", "DESC" ); }