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
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/contacts.ts:177-186 (handler)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) }] }; }, },
- src/tools/index.ts:9-17 (registration)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";