Skip to main content
Glama
deyikong

SendGrid MCP Server

by deyikong

list_custom_fields

Retrieve all custom fields from your SendGrid account to organize contact data and enhance email personalization.

Instructions

List all custom fields

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The core handler function for the 'list_custom_fields' tool. It makes an API request to SendGrid's marketing/field_definitions endpoint and returns the JSON response as formatted text.
    list_custom_fields: { config: { title: "List Custom Fields", description: "List all custom fields", }, handler: async (): Promise<ToolResult> => { const result = await makeRequest("https://api.sendgrid.com/v3/marketing/field_definitions"); return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] }; }, },
  • Registration of the tool via spreading contactTools (which contains list_custom_fields) into the main allTools export used by the MCP server.
    export const allTools = { ...automationTools, ...campaignTools, ...contactTools, ...mailTools, ...miscTools, ...statsTools, ...templateTools, };
  • src/tools/index.ts:4-4 (registration)
    Import of contactTools from contacts.ts into index.ts for inclusion in allTools.
    import { mailTools } from "./mail.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