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
| Name | Required | Description | Default |
|---|---|---|---|
| nickname | Yes | Nickname for the sender | |
| from | Yes | ||
| reply_to | Yes | ||
| address | Yes | Street address | |
| city | Yes | City | |
| state | Yes | State | |
| zip | Yes | ZIP code | |
| country | Yes | Country |
Implementation Reference
- src/tools/contacts.ts:287-305 (handler)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.`, }, ], }; },
- src/tools/contacts.ts:270-286 (schema)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); }
- src/tools/index.ts:9-16 (registration)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,