Skip to main content
Glama
AgentX-ai

Mailchimp MCP Server

by AgentX-ai

list_merge_fields

Retrieve all merge fields from a specific Mailchimp list to access custom subscriber data for email personalization and segmentation.

Instructions

List all merge fields in a specific list

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
list_idYesThe list ID

Implementation Reference

  • The core handler function implementing the logic to list merge fields for a given Mailchimp list ID by calling the Mailchimp API with pagination.
    async listMergeFields(
      listId: string
    ): Promise<{ merge_fields: MailchimpMergeField[] }> {
      return await this.makePaginatedRequest(
        `/lists/${listId}/merge-fields`,
        "display_order",
        "ASC"
      );
    }
  • Registers the 'list_merge_fields' tool in the getToolDefinitions array, including its name, description, and input schema.
    {
      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"],
      },
    },
  • TypeScript interface defining the MailchimpMergeField structure for output data validation and typing.
    export interface MailchimpMergeField {
      id: number;
      name: string;
      type:
        | "text"
        | "number"
        | "address"
        | "phone"
        | "date"
        | "url"
        | "imageurl"
        | "radio"
        | "dropdown"
        | "birthday"
        | "zip";
      required: boolean;
      default_value?: string;
      public: boolean;
      display_order: number;
      options?: {
        default_country?: number;
        phone_format?: string;
        date_format?: string;
        choices?: string[];
        size?: number;
      };
      help_text?: string;
      list_id: string;
      _links?: Array<{
        rel: string;
        href: string;
        method: string;
        targetSchema?: string;
        schema?: string;
      }>;
    }
  • The tool execution handler in handleToolCall that dispatches to the service and formats the merge fields response for the MCP protocol.
    case "list_merge_fields":
      const mergeFields = await service.listMergeFields(args.list_id);
      return {
        content: [
          {
            type: "text",
            text: JSON.stringify(
              mergeFields.merge_fields.map((mf) => ({
                id: mf.id,
                name: mf.name,
                type: mf.type,
                required: mf.required,
                public: mf.public,
                display_order: mf.display_order,
              })),
              null,
              2
            ),
          },
        ],
      };
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the action but doesn't cover critical aspects like whether this is a read-only operation, potential rate limits, authentication requirements, or what the output format looks like (e.g., pagination, error handling). This is inadequate for a tool with no annotation support.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that directly states the tool's function without unnecessary words. It's front-loaded and appropriately sized for its purpose, with no wasted verbiage.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the lack of annotations and output schema, the description is incomplete. It doesn't address behavioral traits, return values, or usage context, leaving significant gaps for an agent to operate effectively with this tool in a real-world scenario.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, with the single parameter 'list_id' clearly documented in the schema. The description adds no additional semantic context beyond implying a list context, so it meets the baseline for high schema coverage without compensating value.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('List all') and resource ('merge fields in a specific list'), making the purpose unambiguous. However, it doesn't differentiate from sibling tools like 'get_merge_field' (singular vs. plural), which might cause confusion about when to use each.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives like 'get_merge_field' or other list-related tools. It lacks context about prerequisites, such as needing an existing list, or exclusions, leaving the agent to infer usage from the name alone.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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