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
| Name | Required | Description | Default |
|---|---|---|---|
| list_id | Yes | The list ID | |
| segment_id | Yes | The segment ID |
Implementation Reference
- src/services/mailchimp.ts:224-229 (handler)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}`); }
- src/tools/index.ts:245-262 (schema)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"], }, },
- src/tools/index.ts:813-822 (registration)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), }, ], };