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
| Name | Required | Description | Default |
|---|---|---|---|
| address | Yes | Street address | |
| city | Yes | City | |
| country | Yes | Country | |
| from | Yes | ||
| nickname | Yes | Nickname for the sender | |
| reply_to | Yes | ||
| state | Yes | State | |
| zip | Yes | ZIP code |
Input Schema (JSON Schema)
{
"properties": {
"address": {
"description": "Street address",
"type": "string"
},
"city": {
"description": "City",
"type": "string"
},
"country": {
"description": "Country",
"type": "string"
},
"from": {
"additionalProperties": false,
"properties": {
"email": {
"description": "From email address",
"type": "string"
},
"name": {
"description": "From name",
"type": "string"
}
},
"required": [
"email",
"name"
],
"type": "object"
},
"nickname": {
"description": "Nickname for the sender",
"type": "string"
},
"reply_to": {
"additionalProperties": false,
"properties": {
"email": {
"description": "Reply-to email address",
"type": "string"
},
"name": {
"description": "Reply-to name",
"type": "string"
}
},
"required": [
"email",
"name"
],
"type": "object"
},
"state": {
"description": "State",
"type": "string"
},
"zip": {
"description": "ZIP code",
"type": "string"
}
},
"required": [
"nickname",
"from",
"reply_to",
"address",
"city",
"state",
"zip",
"country"
],
"type": "object"
}
Implementation Reference
- src/tools/contacts.ts:287-305 (handler)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.`, }, ], }; },
- src/tools/contacts.ts:270-285 (schema)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"), },
- src/tools/contacts.ts:266-306 (registration)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.`, }, ], }; }, },
- src/tools/index.ts:9-17 (registration)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); }