Skip to main content
Glama
AgentX-ai

Mailchimp MCP Server

by AgentX-ai

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
NameRequiredDescriptionDefault
store_idYesThe store ID

Implementation Reference

  • 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"
      );
    }
  • 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"],
      },
  • 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"],
  • 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
            ),
          },
        ],
      };

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/AgentX-ai/mailchimp-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server