Skip to main content
Glama
deyikong

SendGrid MCP Server

by deyikong

create_sender

Create a new sender identity for email campaigns by setting up from address, reply-to details, and physical address information required for email authentication.

Instructions

Create a new sender identity

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
addressYesStreet address
cityYesCity
countryYesCountry
fromYes
nicknameYesNickname for the sender
reply_toYes
stateYesState
zipYesZIP code

Implementation Reference

  • Handler function implementing the create_sender tool: checks read-only mode and POSTs to SendGrid API to create sender.
    handler: async (senderData: any): 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/senders", { method: "POST", body: JSON.stringify(senderData), }); return { content: [ { type: "text", text: `Sender created successfully. ${JSON.stringify(result, null, 2)}\n\nIMPORTANT: Please verify the sender email address if the email's domain is not in the Sender Authentication settings.`, }, ], }; },
  • Zod input schema defining parameters for creating a sender identity.
    inputSchema: { nickname: z.string().describe("Nickname for the sender"), from: z.object({ email: z.string().describe("From email address"), name: z.string().describe("From name"), }), reply_to: z.object({ email: z.string().describe("Reply-to email address"), name: z.string().describe("Reply-to name"), }), address: z.string().describe("Street address"), city: z.string().describe("City"), state: z.string().describe("State"), zip: z.string().describe("ZIP code"), country: z.string().describe("Country"), },
  • Tool object definition for create_sender within contactTools export.
    create_sender: { config: { title: "Create Sender", description: "Create a new sender identity", inputSchema: { nickname: z.string().describe("Nickname for the sender"), from: z.object({ email: z.string().describe("From email address"), name: z.string().describe("From name"), }), reply_to: z.object({ email: z.string().describe("Reply-to email address"), name: z.string().describe("Reply-to name"), }), address: z.string().describe("Street address"), city: z.string().describe("City"), state: z.string().describe("State"), zip: z.string().describe("ZIP code"), country: z.string().describe("Country"), }, }, handler: async (senderData: any): 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/senders", { method: "POST", body: JSON.stringify(senderData), }); return { content: [ { type: "text", text: `Sender created successfully. ${JSON.stringify(result, null, 2)}\n\nIMPORTANT: Please verify the sender email address if the email's domain is not in the Sender Authentication settings.`, }, ], }; }, },
  • Aggregation of all tools including contactTools (with create_sender) into allTools.
    export const allTools = { ...automationTools, ...campaignTools, ...contactTools, ...mailTools, ...miscTools, ...statsTools, ...templateTools, };
  • src/index.ts:21-23 (registration)
    MCP server registration loop that registers create_sender (via allTools) using server.registerTool.
    for (const [name, tool] of Object.entries(allTools)) { server.registerTool(name, tool.config as any, tool.handler as any); }

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