Skip to main content
Glama
deyikong

SendGrid MCP Server

by deyikong

create_email_list

Create a new email list in your SendGrid account to organize contacts for targeted email marketing campaigns.

Instructions

Create a new email list in your SendGrid account

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesName of the email list

Implementation Reference

  • Handler function that checks read-only mode, makes a POST request to SendGrid API to create the email list with the given name, and returns the JSON response.
    handler: async ({ name }: { 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", { method: "POST", body: JSON.stringify({ name }), }); return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] }; },
  • Tool configuration including title, description, and Zod input schema for the 'name' parameter.
    config: { title: "Create Email List", description: "Create a new email list in your SendGrid account", inputSchema: { name: z.string().describe("Name of the email list"), }, },
  • src/index.ts:21-23 (registration)
    Registers all tools, including 'create_email_list', to the MCP server via a loop over the allTools object.
    for (const [name, tool] of Object.entries(allTools)) { server.registerTool(name, tool.config as any, tool.handler as any); }
  • Aggregates all tool objects from modular files, including contactTools containing 'create_email_list', into a single allTools export.
    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