Skip to main content
Glama
deyikong

SendGrid MCP Server

by deyikong

list_email_lists

Retrieve all email marketing lists from SendGrid to manage contacts, segment audiences, and organize recipients for campaigns.

Instructions

List all email lists

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
page_sizeNoNumber of results to return

Implementation Reference

  • The handler function that implements the core logic of the list_email_lists tool by making an API request to SendGrid's marketing lists endpoint.
    handler: async ({ page_size }: { page_size: number }): Promise<ToolResult> => { const result = await makeRequest(`https://api.sendgrid.com/v3/marketing/lists?page_size=${page_size}`); return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] }; },
  • Configuration object defining the tool's metadata and input schema using Zod for validation.
    config: { title: "List Email Lists", description: "List all email lists", inputSchema: { page_size: z.number().optional().default(1000).describe("Number of results to return"), }, },
  • src/index.ts:21-23 (registration)
    Registration of all tools with the MCP server, including list_email_lists via the allTools object.
    for (const [name, tool] of Object.entries(allTools)) { server.registerTool(name, tool.config as any, tool.handler as any); }
  • Inclusion of contactTools (containing list_email_lists) into the allTools export.
    ...contactTools,
  • Import of the makeRequest helper used in the handler to perform authenticated API calls.
    import { makeRequest } from "../shared/api.js";

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