Skip to main content
Glama
AgentX-ai

Mailchimp MCP Server

by AgentX-ai

get_segment

Retrieve specific segment details from Mailchimp lists using list ID and segment ID for targeted email marketing analysis.

Instructions

Get details of a specific segment

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
list_idYesThe list ID
segment_idYesThe segment ID

Implementation Reference

  • The main handler function in MailchimpService that executes the tool logic by making an API request to fetch the specific segment details.
    async getSegment( listId: string, segmentId: number ): Promise<MailchimpSegment> { return await this.makeRequest(`/lists/${listId}/segments/${segmentId}`); }
  • Input schema definition for the get_segment tool, specifying parameters list_id (string) and segment_id (number). Part of the tool definitions returned by getToolDefinitions.
    { 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"], }, },
  • The dispatch case in handleToolCall function that registers and invokes the getSegment service method for the 'get_segment' tool name, formatting the 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), }, ], };

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