Skip to main content
Glama
deyikong

SendGrid MCP Server

by deyikong

update_email_list

Modify an existing email list's properties like name to maintain accurate contact segmentation for targeted email campaigns.

Instructions

Update the properties of an existing email list

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
list_idYesID of the email list to update
nameYesNew name for the email list

Implementation Reference

  • The handler function executes the tool logic: checks read-only mode, performs a PATCH request to the SendGrid API to update the email list's name, and returns the JSON result.
    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) }] }; },
  • The tool configuration including title, description, and Zod inputSchema for parameters list_id and name.
    config: { title: "Update Email List", description: "Update the properties of an existing email list", 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)
    Generic registration loop that registers all tools from allTools, including update_email_list, to the MCP server.
    for (const [name, tool] of Object.entries(allTools)) { server.registerTool(name, tool.config as any, tool.handler as any); }
  • Aggregation of all tool objects into allTools, including contactTools which contains update_email_list.
    export const allTools = { ...automationTools, ...campaignTools, ...contactTools, ...mailTools, ...miscTools, ...statsTools, ...templateTools,

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/deyikong/sendgrid-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server