list_custom_fields
Retrieve all custom fields defined in your SendGrid account to organize and segment contact data for targeted email campaigns.
Instructions
List all custom fields
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/contacts.ts:182-185 (handler)The handler function for the 'list_custom_fields' tool. It makes an API request to SendGrid's marketing/field_definitions endpoint and returns the result as formatted JSON.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/contacts.ts:178-181 (schema)The configuration object defining the tool's title and description, used for schema generation in MCP.config: { title: "List Custom Fields", description: "List all custom fields", },
- src/index.ts:21-23 (registration)The registration code in the main MCP server file that registers all tools, including 'list_custom_fields', by iterating over allTools and calling registerTool.for (const [name, tool] of Object.entries(allTools)) { server.registerTool(name, tool.config as any, tool.handler as any); }
- src/tools/index.ts:12-12 (registration)Spreading of contactTools into allTools, making 'list_custom_fields' available for registration....contactTools,
- src/tools/contacts.ts:6-6 (registration)Export of contactTools object containing the 'list_custom_fields' tool definition.export const contactTools = {