Skip to main content
Glama
deyikong

SendGrid MCP Server

by deyikong

list_segments

Retrieve all email list segments and their parent list relationships for targeted audience management in SendGrid campaigns.

Instructions

List all segments with their parent list relationships

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function that fetches all segments from the SendGrid API and returns the JSON response.
    handler: async (): Promise<ToolResult> => { const result = await makeRequest("https://api.sendgrid.com/v3/marketing/segments"); return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] }; },
  • Configuration for the list_segments tool, including title and description. No input schema as the tool requires no parameters.
    config: { title: "List Segments", description: "List all segments with their parent list relationships", },
  • Includes contactTools (which contains list_segments) in the allTools object export.
    ...contactTools,
  • src/index.ts:21-23 (registration)
    Loop that registers every tool from allTools, including list_segments, with the MCP server.
    for (const [name, tool] of Object.entries(allTools)) { server.registerTool(name, tool.config as any, tool.handler as any); }

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