update_email_list
Modify an existing email list by changing its name or other properties to keep your contact management organized and current.
Instructions
Update the properties of an existing email list
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| list_id | Yes | ID of the email list to update | |
| name | Yes | New name for the email list |
Implementation Reference
- src/tools/contacts.ts:52-63 (handler)The core handler function implementing the update_email_list tool. It performs a PATCH request to the SendGrid Marketing Lists API endpoint to update the name of the specified email list, after checking read-only mode.handler: async ({ list_id, name }: { list_id: string; name: string }): Promise<ToolResult> => { const readOnlyCheck = checkReadOnlyMode(); if (readOnlyCheck.blocked) { return { content: [{ type: "text", text: readOnlyCheck.message! }] }; } const result = await makeRequest(`https://api.sendgrid.com/v3/marketing/lists/${list_id}`, { method: "PATCH", body: JSON.stringify({ name }), }); return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] }; },
- src/tools/contacts.ts:47-50 (schema)Zod-based input schema defining the required parameters for the update_email_list tool: list_id (string) and name (string).inputSchema: { list_id: z.string().describe("ID of the email list to update"), name: z.string().describe("New name for the email list"), },
- src/index.ts:21-23 (registration)MCP server registration loop that dynamically registers all tools from allTools, including 'update_email_list', by iterating and calling server.registerTool for each.for (const [name, tool] of Object.entries(allTools)) { server.registerTool(name, tool.config as any, tool.handler as any); }
- src/tools/index.ts:12-12 (registration)Inclusion of contactTools (which contains update_email_list) into the allTools export via object spread....contactTools,