Skip to main content
Glama
deyikong

SendGrid MCP Server

by deyikong

create_sender

Create a new sender identity in SendGrid by specifying email addresses, names, and physical address details for email authentication.

Instructions

Create a new sender identity

Input Schema

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

Implementation Reference

  • The main handler function for the 'create_sender' tool. It checks read-only mode, then makes a POST request to SendGrid API to create a new sender identity, and returns a success message with verification note.
    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 schema defining the input parameters for the create_sender tool, including sender details like nickname, from/reply_to emails, and address information.
    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"), }, },
  • src/index.ts:21-23 (registration)
    Generic registration loop that registers the 'create_sender' tool (from allTools) with the MCP server using its config and handler.
    for (const [name, tool] of Object.entries(allTools)) { server.registerTool(name, tool.config as any, tool.handler as any); }
  • Combines contactTools (containing create_sender) into allTools, which is then imported and registered in src/index.ts.
    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