get_merge_field
Retrieve details of a specific merge field from a Mailchimp list to access custom audience data for targeted email campaigns.
Instructions
Get details of a specific merge field
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| list_id | Yes | The list ID | |
| merge_field_id | Yes | The merge field ID |
Implementation Reference
- src/tools/index.ts:960-972 (handler)Handler for the 'get_merge_field' tool call. It invokes the MailchimpService.getMergeField method with list_id and merge_field_id parameters and returns the result as a formatted text response.case "get_merge_field": const mergeField = await service.getMergeField( args.list_id, args.merge_field_id ); return { content: [ { type: "text", text: JSON.stringify(mergeField, null, 2), }, ], };
- src/tools/index.ts:360-377 (schema)Tool schema definition including name, description, and input schema for 'get_merge_field' in the getToolDefinitions array.{ name: "get_merge_field", description: "Get details of a specific merge field", inputSchema: { type: "object", properties: { list_id: { type: "string", description: "The list ID", }, merge_field_id: { type: "number", description: "The merge field ID", }, }, required: ["list_id", "merge_field_id"], }, },
- src/services/mailchimp.ts:371-378 (helper)Core helper method in MailchimpService that performs the API request to retrieve a specific merge field from a Mailchimp list.async getMergeField( listId: string, mergeFieldId: number ): Promise<MailchimpMergeField> { return await this.makeRequest( `/lists/${listId}/merge-fields/${mergeFieldId}` ); }