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 and manage contacts for email marketing campaigns.

Instructions

Create a new email list in your SendGrid account

Input Schema

NameRequiredDescriptionDefault
nameYesName of the email list

Input Schema (JSON Schema)

{ "properties": { "name": { "description": "Name of the email list", "type": "string" } }, "required": [ "name" ], "type": "object" }

Implementation Reference

  • The handler function that implements the core logic for creating a new email list using SendGrid API, including read-only mode check.
    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) }] }; },
  • Configuration including title, description, and input schema (Zod validation) for the create_email_list tool.
    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)
    MCP server registration loop that registers the create_email_list tool (via allTools) with its config and handler.
    for (const [name, tool] of Object.entries(allTools)) { server.registerTool(name, tool.config as any, tool.handler as any); }
  • Spreading contactTools (which contains create_email_list) into the allTools export for central registration.
    ...contactTools,
  • src/tools/index.ts:3-3 (registration)
    Import of contactTools module containing the create_email_list tool definition.
    import { contactTools } from "./contacts.js";

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