Skip to main content
Glama
deyikong

SendGrid MCP Server

by deyikong

List Custom Fields

list_custom_fields

Retrieve all custom fields defined in your SendGrid account to manage and organize contact data.

Instructions

List all custom fields

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function for the list_custom_fields tool, which calls the SendGrid API to retrieve all marketing field definitions and returns the result as JSON.
    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) }] };
      },
    },
  • The contactTools export object that contains the list_custom_fields definition, which is spread into allTools in src/tools/index.ts.
    export const contactTools = {
  • The allTools object that aggregates all tool modules including contactTools (which contains list_custom_fields). This is what gets registered in the MCP server.
    export const allTools = {
      ...automationTools,
      ...campaignTools,
      ...contactTools,
      ...mailTools,
      ...miscTools,
      ...statsTools,
      ...templateTools,
    };
  • src/index.ts:20-23 (registration)
    The MCP server registration loop that registers each tool (including list_custom_fields) with the server via server.registerTool().
    // Register all tools
    for (const [name, tool] of Object.entries(allTools)) {
      server.registerTool(name, tool.config as any, tool.handler as any);
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description should disclose behavioral traits. It only states 'List all custom fields' without mentioning pagination, limits, or any side effects, leaving the agent uninformed about potential constraints.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, succinct sentence with no extraneous information, earning its place efficiently.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple list tool with no output schema, the description is adequate but lacks details on response format or limitations, leaving moderate completeness gaps.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 0 parameters, so baseline is 4. The description does not add parameter info, but none is needed since the schema fully defines the empty parameter set.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'List all custom fields' clearly states a specific verb (List) and resource (custom fields), distinguishing it from sibling tools that create, update, or delete custom fields.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No usage guidelines are provided; the description does not specify when to use this tool versus alternatives like search_contacts or list_senders.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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