Skip to main content
Glama
deyikong

SendGrid MCP Server

by deyikong

list_single_sends

Retrieve and view all single send email campaigns from your SendGrid account to monitor campaign performance and manage your email marketing activities.

Instructions

List all single send campaigns

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
page_sizeNoNumber of results to return

Implementation Reference

  • The handler function that fetches and returns the list of single send campaigns from the SendGrid API.
    handler: async ({ page_size }: { page_size: number }): Promise<ToolResult> => { const result = await makeRequest(`https://api.sendgrid.com/v3/marketing/singlesends/search?page_size=${page_size}`); return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] }; },
  • Configuration object defining the tool's metadata and input schema for validation using Zod.
    config: { title: "List Single Send Campaigns", description: "List all single send campaigns", inputSchema: { page_size: z.number().optional().default(50).describe("Number of results to return"), }, },
  • Registration of the campaignTools (containing list_single_sends) into the central allTools export.
    export const allTools = { ...automationTools, ...campaignTools, ...contactTools, ...mailTools, ...miscTools, ...statsTools, ...templateTools, };
  • Export of campaignTools object that defines and registers the list_single_sends tool among other campaign tools.
    export const campaignTools = { list_single_sends: { config: { title: "List Single Send Campaigns", description: "List all single send campaigns", inputSchema: { page_size: z.number().optional().default(50).describe("Number of results to return"), }, }, handler: async ({ page_size }: { page_size: number }): Promise<ToolResult> => { const result = await makeRequest(`https://api.sendgrid.com/v3/marketing/singlesends/search?page_size=${page_size}`); return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] }; }, }, open_single_send_creator: { config: { title: "Open Single Send Creator", description: "Open SendGrid single send creator in browser", }, handler: async (): Promise<ToolResult> => { return { content: [ { type: "text", text: "Please open this URL in your browser to create a new single send:\nhttps://mc.sendgrid.com/single-sends/new/selector/your-designs?view=raw", }, ], }; }, }, open_single_send_stats: { config: { title: "Open Single Send Stats", description: "Open single send stats page for a specific campaign", inputSchema: { singlesend_id: z.string().describe("The single send ID to view stats for"), }, }, handler: async ({ singlesend_id }: { singlesend_id: string }): Promise<ToolResult> => { return { content: [ { type: "text", text: `Please open this URL in your browser to view stats for single send ${singlesend_id}:\nhttps://mc.sendgrid.com/single-sends/${singlesend_id}/stats?view=raw`, }, ], }; }, }, };

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