Skip to main content
Glama
deyikong

SendGrid MCP Server

by deyikong

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
NameRequiredDescriptionDefault
list_idYesID of the email list to update
nameYesNew name for the email list

Implementation Reference

  • 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) }] }; },
  • 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); }
  • Inclusion of contactTools (which contains update_email_list) into the allTools export via object spread.
    ...contactTools,

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