list_products
Retrieve all products from a Mailchimp-connected store by providing the store ID to manage product data for email marketing campaigns.
Instructions
List all products in a store
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| store_id | Yes | The store ID |
Implementation Reference
- src/services/mailchimp.ts:309-317 (handler)The core handler function that executes the logic to list products for a given store ID by making a paginated request to the Mailchimp E-commerce API endpoint.async listProducts( storeId: string ): Promise<{ products: MailchimpProduct[] }> { return await this.makePaginatedRequest( `/ecommerce/stores/${storeId}/products`, "created_at", "DESC" ); }
- src/tools/index.ts:450-463 (registration)Tool registration definition including name, description, and input schema for the 'list_products' tool in getToolDefinitions.// E-commerce Products { name: "list_products", description: "List all products in a store", inputSchema: { type: "object", properties: { store_id: { type: "string", description: "The store ID", }, }, required: ["store_id"], },
- src/tools/index.ts:453-462 (schema)Input schema definition validating the required 'store_id' parameter for the tool.description: "List all products in a store", inputSchema: { type: "object", properties: { store_id: { type: "string", description: "The store ID", }, }, required: ["store_id"],
- src/tools/index.ts:1071-1089 (handler)Dispatcher handler case in handleToolCall that invokes the service handler and formats the response as MCP tool output.case "list_products": const products = await service.listProducts(args.store_id); return { content: [ { type: "text", text: JSON.stringify( products.products.map((p) => ({ id: p.id, title: p.title, type: p.type, vendor: p.vendor, })), null, 2 ), }, ], };