create_contact_list
Create a new contact list in SendGrid to organize email recipients for targeted marketing campaigns.
Instructions
Create a new contact list in SendGrid
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Name of the contact list |
Implementation Reference
- src/tools/index.ts:403-406 (handler)Handler logic for the 'create_contact_list' tool within the handleToolCall switch statement. It invokes SendGridService.createList with the input 'name' argument and returns a formatted success response including the new list ID.case 'create_contact_list': const list = await service.createList(args.name); return { content: [{ type: 'text', text: `Contact list "${args.name}" created with ID: ${list.id}` }] };
- src/tools/index.ts:95-108 (schema)Tool definition including name, description, and input schema requiring a 'name' string parameter.{ name: 'create_contact_list', description: 'Create a new contact list in SendGrid', inputSchema: { type: 'object', properties: { name: { type: 'string', description: 'Name of the contact list' } }, required: ['name'] } },
- src/services/sendgrid.ts:109-116 (helper)SendGridService method that performs the actual API call to create a new contact list using SendGrid's Marketing Lists endpoint.async createList(name: string): Promise<SendGridList> { const [response] = await this.client.request({ method: 'POST', url: '/v3/marketing/lists', body: { name } }); return response.body as SendGridList; }