Skip to main content
Glama
AgentX-ai

Mailchimp MCP Server

by AgentX-ai

list_segments

Retrieve all audience segments from a Mailchimp email list to analyze subscriber groups and target specific audiences for email campaigns.

Instructions

List all segments in a specific list

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
list_idYesThe list ID

Implementation Reference

  • The core handler function that executes the logic to list segments for a given Mailchimp list ID by making a paginated API request.
    async listSegments(
      listId: string
    ): Promise<{ segments: MailchimpSegment[] }> {
      return await this.makePaginatedRequest(
        `/lists/${listId}/segments`,
        "created_at",
        "DESC"
      );
    }
  • Input schema definition for the list_segments tool, requiring a list_id parameter.
    {
      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"],
      },
    },
  • Registration of the list_segments tool in the getToolDefinitions array.
    {
      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"],
      },
    },
  • Tool dispatch handler in handleToolCall that invokes the service method and formats the response as JSON text.
    case "list_segments":
      const segments = await service.listSegments(args.list_id);
      return {
        content: [
          {
            type: "text",
            text: JSON.stringify(
              segments.segments.map((s) => ({
                id: s.id,
                name: s.name,
                member_count: s.member_count,
                type: s.type,
                created_at: s.created_at,
              })),
              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 full burden. It states it 'List all segments', implying a read-only operation, but doesn't disclose behavioral traits like pagination, rate limits, authentication needs, or what 'all' entails (e.g., if it returns archived segments). For a list operation with no annotations, this leaves significant gaps in understanding how it behaves.

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 purpose without unnecessary words. It is appropriately sized and front-loaded, with every part contributing to understanding the tool's function.

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 no annotations, no output schema, and a simple input schema, the description is incomplete. It lacks details on return values (e.g., format of segments), error conditions, or operational constraints. For a tool in a context with many sibling retrieval tools, more context is needed to ensure correct usage.

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 parameter 'list_id' fully documented in the schema. The description adds no additional meaning beyond implying the list context, which is already covered by the schema's description. This meets the baseline of 3 when schema coverage is high.

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 verb ('List') and resource ('segments in a specific list'), making the purpose understandable. However, it doesn't differentiate from sibling tools like 'get_segment' or 'list_members', which could lead to confusion about when to use this specific list operation versus other retrieval tools.

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?

No guidance is provided on when to use this tool versus alternatives like 'get_segment' (which likely retrieves a single segment) or 'list_members' (which might list members rather than segments). The description mentions 'in a specific list', but this is part of the purpose rather than usage context or exclusions.

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