Skip to main content
Glama
deyikong

SendGrid MCP Server

by deyikong

Update Custom Field

update_custom_field

Modify an existing custom field definition in SendGrid to update its name and manage contact data fields for email marketing operations.

Instructions

Update an existing custom field definition

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
field_idYesID of the custom field to update
nameYesNew name for the custom field

Implementation Reference

  • The main handler function for the 'update_custom_field' tool. It checks read-only mode and performs a PUT request to the SendGrid API to update the custom field's name.
    handler: async ({ field_id, name }: { field_id: string; name: string }): Promise<ToolResult> => {
      const readOnlyCheck = checkReadOnlyMode();
      if (readOnlyCheck.blocked) {
        return { content: [{ type: "text", text: readOnlyCheck.message! }] };
      }
      
      const result = await makeRequest(`https://api.sendgrid.com/v3/marketing/field_definitions/${field_id}`, {
        method: "PUT",
        body: JSON.stringify({ name }),
      });
      return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
    },
  • The configuration object including title, description, and Zod input schema for validating the tool's parameters.
    config: {
      title: "Update Custom Field",
      description: "Update an existing custom field definition",
      inputSchema: {
        field_id: z.string().describe("ID of the custom field to update"),
        name: z.string().describe("New name for the custom field"),
      },
    },
  • The tool definition object within contactTools, which registers the 'update_custom_field' tool for export and use.
    update_custom_field: {
      config: {
        title: "Update Custom Field",
        description: "Update an existing custom field definition",
        inputSchema: {
          field_id: z.string().describe("ID of the custom field to update"),
          name: z.string().describe("New name for the custom field"),
        },
      },
      handler: async ({ field_id, name }: { field_id: string; name: string }): Promise<ToolResult> => {
        const readOnlyCheck = checkReadOnlyMode();
        if (readOnlyCheck.blocked) {
          return { content: [{ type: "text", text: readOnlyCheck.message! }] };
        }
        
        const result = await makeRequest(`https://api.sendgrid.com/v3/marketing/field_definitions/${field_id}`, {
          method: "PUT",
          body: JSON.stringify({ name }),
        });
        return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
      },
    },
  • Imports contactTools (containing update_custom_field) and spreads it into the allTools object, effectively registering it globally.
    import { contactTools } from "./contacts.js";
    import { mailTools } from "./mail.js";
    import { miscTools } from "./misc.js";
    import { statsTools } from "./stats.js";
    import { templateTools } from "./templates.js";
    
    export const allTools = {
      ...automationTools,
      ...campaignTools,
      ...contactTools,
Behavior2/5

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

No annotations are provided, so the description carries full burden. It states 'Update an existing custom field definition,' implying a mutation operation, but lacks details on permissions required, whether changes are reversible, side effects (e.g., impact on existing data), rate limits, or response format. This is a significant gap for a mutation tool with zero annotation coverage.

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, efficient sentence with zero waste. It's front-loaded and appropriately sized for the tool's complexity, making it easy to parse without unnecessary elaboration.

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

Completeness2/5

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

Given the tool is a mutation operation with no annotations and no output schema, the description is incomplete. It lacks behavioral context (e.g., permissions, side effects), usage guidelines, and details on return values. For a 2-parameter update tool, this minimal description leaves critical gaps for an agent to operate effectively.

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

Parameters3/5

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

Schema description coverage is 100%, with both parameters ('field_id' and 'name') clearly documented in the schema. The description adds no additional meaning beyond what the schema provides, such as format examples or constraints. Baseline 3 is appropriate when the schema does the heavy lifting.

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

Purpose4/5

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

The description clearly states the verb ('Update') and resource ('existing custom field definition'), making the purpose unambiguous. It distinguishes from sibling tools like 'create_custom_field' by specifying it's for existing fields, though it doesn't explicitly contrast with other update tools like 'update_contact' or 'update_template'.

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 guidance is provided on when to use this tool versus alternatives. The description doesn't mention prerequisites (e.g., needing an existing custom field ID), exclusions, or comparisons with other update tools (like 'update_template' or 'update_contact'), leaving the agent to infer usage context.

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