Skip to main content
Glama
AgentX-ai

Mailchimp MCP Server

by AgentX-ai

get_automation_email

Retrieve specific email details from a Mailchimp automation workflow to analyze content and configuration.

Instructions

Get details of a specific email in an automation

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
workflow_idYesThe workflow ID of the automation
email_idYesThe email ID within the automation

Implementation Reference

  • Handler for the 'get_automation_email' tool call. Extracts workflow_id and email_id from args, calls MailchimpService.getAutomationEmail, and returns the email details as a JSON-formatted text response.
    case "get_automation_email":
      const email = await service.getAutomationEmail(
        args.workflow_id,
        args.email_id
      );
      return {
        content: [
          {
            type: "text",
            text: JSON.stringify(email, null, 2),
          },
        ],
      };
  • Input schema definition for the 'get_automation_email' tool, specifying required workflow_id and email_id parameters.
    {
      name: "get_automation_email",
      description: "Get details of a specific email in an automation",
      inputSchema: {
        type: "object",
        properties: {
          workflow_id: {
            type: "string",
            description: "The workflow ID of the automation",
          },
          email_id: {
            type: "string",
            description: "The email ID within the automation",
          },
        },
        required: ["workflow_id", "email_id"],
      },
    },
  • The getToolDefinitions function registers the 'get_automation_email' tool by including it in the array of tool definitions returned for MCP tool registration.
    export const getToolDefinitions = (service: MailchimpService) => [
      {
        name: "list_automations",
        description: "List all automations in your Mailchimp account",
        inputSchema: {
          type: "object",
          properties: {},
          required: [],
        },
      },
      {
        name: "get_automation",
        description: "Get details of a specific automation by workflow ID",
        inputSchema: {
          type: "object",
          properties: {
            workflow_id: {
              type: "string",
              description: "The workflow ID of the automation",
            },
          },
          required: ["workflow_id"],
        },
      },
      {
        name: "list_automation_emails",
        description: "List all emails in an automation",
        inputSchema: {
          type: "object",
          properties: {
            workflow_id: {
              type: "string",
              description: "The workflow ID of the automation",
            },
          },
          required: ["workflow_id"],
        },
      },
      {
        name: "get_automation_email",
        description: "Get details of a specific email in an automation",
        inputSchema: {
          type: "object",
          properties: {
            workflow_id: {
              type: "string",
              description: "The workflow ID of the automation",
            },
            email_id: {
              type: "string",
              description: "The email ID within the automation",
            },
          },
          required: ["workflow_id", "email_id"],
        },
      },
      {
        name: "list_automation_subscribers",
        description: "List subscribers in an automation email queue",
        inputSchema: {
          type: "object",
          properties: {
            workflow_id: {
              type: "string",
              description: "The workflow ID of the automation",
            },
            email_id: {
              type: "string",
              description: "The email ID within the automation",
            },
          },
          required: ["workflow_id", "email_id"],
        },
      },
      {
        name: "get_automation_queue",
        description: "Get the automation email queue",
        inputSchema: {
          type: "object",
          properties: {
            workflow_id: {
              type: "string",
              description: "The workflow ID of the automation",
            },
            email_id: {
              type: "string",
              description: "The email ID within the automation",
            },
          },
          required: ["workflow_id", "email_id"],
        },
      },
      {
        name: "list_lists",
        description:
          "List all lists in your Mailchimp account (for automation recipients)",
        inputSchema: {
          type: "object",
          properties: {},
          required: [],
        },
      },
      {
        name: "get_list",
        description: "Get details of a specific list",
        inputSchema: {
          type: "object",
          properties: {
            list_id: {
              type: "string",
              description: "The list ID",
            },
          },
          required: ["list_id"],
        },
      },
      {
        name: "get_automation_report",
        description: "Get automation report data",
        inputSchema: {
          type: "object",
          properties: {
            workflow_id: {
              type: "string",
              description: "The workflow ID of the automation",
            },
          },
          required: ["workflow_id"],
        },
      },
      {
        name: "get_automation_email_report",
        description: "Get automation email report data",
        inputSchema: {
          type: "object",
          properties: {
            workflow_id: {
              type: "string",
              description: "The workflow ID of the automation",
            },
            email_id: {
              type: "string",
              description: "The email ID within the automation",
            },
          },
          required: ["workflow_id", "email_id"],
        },
      },
      {
        name: "get_subscriber_activity",
        description: "Get subscriber activity for an automation email",
        inputSchema: {
          type: "object",
          properties: {
            workflow_id: {
              type: "string",
              description: "The workflow ID of the automation",
            },
            email_id: {
              type: "string",
              description: "The email ID within the automation",
            },
            subscriber_hash: {
              type: "string",
              description: "The subscriber hash",
            },
          },
          required: ["workflow_id", "email_id", "subscriber_hash"],
        },
      },
      // Campaign Management
      {
        name: "list_campaigns",
        description: "List all campaigns in your Mailchimp account",
        inputSchema: {
          type: "object",
          properties: {},
          required: [],
        },
      },
      {
        name: "get_campaign",
        description: "Get details of a specific campaign",
        inputSchema: {
          type: "object",
          properties: {
            campaign_id: {
              type: "string",
              description: "The campaign ID",
            },
          },
          required: ["campaign_id"],
        },
      },
      // Member Management
      {
        name: "list_members",
        description: "List all members in a specific list",
        inputSchema: {
          type: "object",
          properties: {
            list_id: {
              type: "string",
              description: "The list ID",
            },
          },
          required: ["list_id"],
        },
      },
      {
        name: "get_member",
        description: "Get details of a specific member",
        inputSchema: {
          type: "object",
          properties: {
            list_id: {
              type: "string",
              description: "The list ID",
            },
            subscriber_hash: {
              type: "string",
              description: "The subscriber hash",
            },
          },
          required: ["list_id", "subscriber_hash"],
        },
      },
      // Segment Management
      {
        name: "list_segments",
        description: "List all segments in a specific list",
        inputSchema: {
          type: "object",
          properties: {
            list_id: {
              type: "string",
              description: "The list ID",
            },
          },
          required: ["list_id"],
        },
      },
      {
        name: "get_segment",
        description: "Get details of a specific segment",
        inputSchema: {
          type: "object",
          properties: {
            list_id: {
              type: "string",
              description: "The list ID",
            },
            segment_id: {
              type: "number",
              description: "The segment ID",
            },
          },
          required: ["list_id", "segment_id"],
        },
      },
      // Template Management
      {
        name: "list_templates",
        description: "List all templates in your Mailchimp account",
        inputSchema: {
          type: "object",
          properties: {},
          required: [],
        },
      },
      {
        name: "get_template",
        description: "Get details of a specific template",
        inputSchema: {
          type: "object",
          properties: {
            template_id: {
              type: "number",
              description: "The template ID",
            },
          },
          required: ["template_id"],
        },
      },
      // Campaign Reports
      {
        name: "list_campaign_reports",
        description: "List all campaign reports",
        inputSchema: {
          type: "object",
          properties: {},
          required: [],
        },
      },
      {
        name: "get_campaign_report",
        description: "Get detailed report for a specific campaign",
        inputSchema: {
          type: "object",
          properties: {
            campaign_id: {
              type: "string",
              description: "The campaign ID",
            },
          },
          required: ["campaign_id"],
        },
      },
      // Account Information
      {
        name: "get_account",
        description: "Get account information",
        inputSchema: {
          type: "object",
          properties: {},
          required: [],
        },
      },
      // Folder Management
      {
        name: "list_folders",
        description: "List all campaign folders",
        inputSchema: {
          type: "object",
          properties: {},
          required: [],
        },
      },
      {
        name: "get_folder",
        description: "Get details of a specific folder",
        inputSchema: {
          type: "object",
          properties: {
            folder_id: {
              type: "string",
              description: "The folder ID",
            },
          },
          required: ["folder_id"],
        },
      },
      // Merge Fields
      {
        name: "list_merge_fields",
        description: "List all merge fields in a specific list",
        inputSchema: {
          type: "object",
          properties: {
            list_id: {
              type: "string",
              description: "The list ID",
            },
          },
          required: ["list_id"],
        },
      },
      {
        name: "get_merge_field",
        description: "Get details of a specific merge field",
        inputSchema: {
          type: "object",
          properties: {
            list_id: {
              type: "string",
              description: "The list ID",
            },
            merge_field_id: {
              type: "number",
              description: "The merge field ID",
            },
          },
          required: ["list_id", "merge_field_id"],
        },
      },
      // File Manager
      {
        name: "list_files",
        description: "List all files in the File Manager",
        inputSchema: {
          type: "object",
          properties: {},
          required: [],
        },
      },
      {
        name: "get_file",
        description: "Get details of a specific file",
        inputSchema: {
          type: "object",
          properties: {
            file_id: {
              type: "string",
              description: "The file ID",
            },
          },
          required: ["file_id"],
        },
      },
      // Landing Pages
      {
        name: "list_landing_pages",
        description: "List all landing pages",
        inputSchema: {
          type: "object",
          properties: {},
          required: [],
        },
      },
      {
        name: "get_landing_page",
        description: "Get details of a specific landing page",
        inputSchema: {
          type: "object",
          properties: {
            page_id: {
              type: "string",
              description: "The landing page ID",
            },
          },
          required: ["page_id"],
        },
      },
      // E-commerce Stores
      {
        name: "list_stores",
        description: "List all e-commerce stores",
        inputSchema: {
          type: "object",
          properties: {},
          required: [],
        },
      },
      {
        name: "get_store",
        description: "Get details of a specific store",
        inputSchema: {
          type: "object",
          properties: {
            store_id: {
              type: "string",
              description: "The store ID",
            },
          },
          required: ["store_id"],
        },
      },
      // 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"],
        },
      },
      {
        name: "get_product",
        description: "Get details of a specific product",
        inputSchema: {
          type: "object",
          properties: {
            store_id: {
              type: "string",
              description: "The store ID",
            },
            product_id: {
              type: "string",
              description: "The product ID",
            },
          },
          required: ["store_id", "product_id"],
        },
      },
      // E-commerce Orders
      {
        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"],
        },
      },
      {
        name: "get_order",
        description: "Get details of a specific order",
        inputSchema: {
          type: "object",
          properties: {
            store_id: {
              type: "string",
              description: "The store ID",
            },
            order_id: {
              type: "string",
              description: "The order ID",
            },
          },
          required: ["store_id", "order_id"],
        },
      },
      // Conversations
      {
        name: "list_conversations",
        description: "List all conversations",
        inputSchema: {
          type: "object",
          properties: {},
          required: [],
        },
      },
      {
        name: "get_conversation",
        description: "Get details of a specific conversation",
        inputSchema: {
          type: "object",
          properties: {
            conversation_id: {
              type: "string",
              description: "The conversation ID",
            },
          },
          required: ["conversation_id"],
        },
      },
    ];
  • Helper method in MailchimpService that makes the API request to retrieve details of a specific automation email from Mailchimp.
    async getAutomationEmail(
      workflowId: string,
      emailId: string
    ): Promise<MailchimpAutomationEmail> {
      return await this.makeRequest(
        `/automations/${workflowId}/emails/${emailId}`
      );
    }

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