Skip to main content
Glama
AgentX-ai

Mailchimp MCP Server

by AgentX-ai

get_merge_field

Retrieve specific merge field details from a Mailchimp list using list ID and merge field ID for email marketing data management.

Instructions

Get details of a specific merge field

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
list_idYesThe list ID
merge_field_idYesThe merge field ID

Implementation Reference

  • Core handler function in MailchimpService that executes the API call to retrieve a specific merge field by list ID and merge field ID.
    async getMergeField(
      listId: string,
      mergeFieldId: number
    ): Promise<MailchimpMergeField> {
      return await this.makeRequest(
        `/lists/${listId}/merge-fields/${mergeFieldId}`
      );
    }
  • Tool dispatch handler in handleToolCall that calls the service method and returns formatted JSON response.
    case "get_merge_field":
      const mergeField = await service.getMergeField(
        args.list_id,
        args.merge_field_id
      );
      return {
        content: [
          {
            type: "text",
            text: JSON.stringify(mergeField, null, 2),
          },
        ],
      };
  • Tool registration including name, description, and input schema definition in getToolDefinitions.
      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"],
      },
    },
  • Input schema for the get_merge_field tool.
      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"],
      },
    },

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