Skip to main content
Glama
AgentX-ai

Mailchimp MCP Server

by AgentX-ai

get_segment

Retrieve detailed information about a specific Mailchimp email list segment using list and segment IDs for targeted audience analysis.

Instructions

Get details of a specific segment

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
list_idYesThe list ID
segment_idYesThe segment ID

Implementation Reference

  • The handler function that executes the core logic of fetching a Mailchimp segment by list ID and segment ID.
    async getSegment(
      listId: string,
      segmentId: number
    ): Promise<MailchimpSegment> {
      return await this.makeRequest(`/lists/${listId}/segments/${segmentId}`);
    }
  • Input schema and tool definition for the get_segment tool.
      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"],
      },
    },
  • Tool dispatch/registration in the handleToolCall switch statement, which calls the handler and returns the formatted response.
    case "get_segment":
      const segment = await service.getSegment(args.list_id, args.segment_id);
      return {
        content: [
          {
            type: "text",
            text: JSON.stringify(segment, null, 2),
          },
        ],
      };
  • TypeScript interface defining the structure of a Mailchimp segment (output type).
    export interface MailchimpSegment {
      id: number;
      name: string;
      member_count: number;
      type: "saved" | "static" | "fuzzy";
      created_at: string;
      updated_at: string;
      options?: {
        match: "any" | "all";
        conditions: Array<{
          condition_type: string;
          op: string;
          field: string;
          value: string;
        }>;
      };
      list_id: string;
      _links?: Array<{
        rel: string;
        href: string;
        method: string;
        targetSchema?: string;
        schema?: string;
      }>;
    }
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 tool retrieves details but doesn't specify what details are returned, whether it's a read-only operation, error conditions (e.g., invalid IDs), or performance characteristics. For a retrieval tool with zero annotation coverage, this leaves significant gaps in understanding how the tool 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 with zero wasted words. It's front-loaded with the core purpose ('Get details of a specific segment'), making it easy to parse. Every word earns its place, and there's no redundancy or unnecessary elaboration.

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 for a retrieval tool. It doesn't explain what 'details' are returned (e.g., fields, structure), error handling, or how it fits into the broader context of segment management. While the schema covers parameters well, the overall tool behavior remains underspecified for effective agent use.

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 both parameters (list_id and segment_id) clearly documented in the schema. The description adds no additional meaning beyond the schema—it doesn't explain the relationship between list and segment, format requirements, or example values. With high schema coverage, the baseline score of 3 is appropriate as the description doesn't compensate but also doesn't detract.

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 ('Get details') and resource ('of a specific segment'), making the purpose unambiguous. It distinguishes from sibling tools like 'list_segments' by specifying retrieval of a single segment rather than listing multiple segments. However, it doesn't explicitly differentiate from other 'get_' tools that retrieve different resources.

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. It doesn't mention prerequisites (e.g., needing a valid list_id and segment_id), when not to use it (e.g., for listing segments instead), or how it relates to sibling tools like 'list_segments' or 'get_list'. The agent must infer usage from the tool name and parameters 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