Skip to main content
Glama
deyikong

SendGrid MCP Server

by deyikong

Update Custom Field

update_custom_field

Update the name of an existing custom field by providing its field ID and new name.

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 update_custom_field tool definition with its config (title, description, inputSchema with field_id and name) and handler that calls PUT on field_definitions/{field_id} with the new name.
    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) }] };
      },
  • Input schema for update_custom_field validating field_id (string) and name (string) using Zod.
    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"),
      },
    },
  • src/index.ts:20-22 (registration)
    Tools are registered dynamically by iterating over allTools. update_custom_field is registered as a tool because it's part of contactTools which is spread into allTools.
    // Register all tools
    for (const [name, tool] of Object.entries(allTools)) {
      server.registerTool(name, tool.config as any, tool.handler as any);
  • contactTools (which contains update_custom_field) is spread into allTools, making it available for registration.
    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?

With no annotations provided, the description carries full burden for behavioral disclosure. It only says 'update' which implies mutation but provides no details on idempotency, partial vs full update, side effects, or required permissions.

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

Conciseness4/5

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

The description is a single concise sentence that communicates the core purpose without any wasted words. However, it could be slightly more structured with additional context.

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 no output schema and sparse annotations, the description is insufficiently complete. It lacks information about return values, error handling, or confirmation of success. For a mutation tool, more context is needed.

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?

The input schema has 100% coverage with descriptions for both parameters. The description adds no extra meaning beyond summarizing the action, which is baseline for high schema coverage.

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 clearly states 'Update an existing custom field definition', which is a specific verb and resource. Among sibling tools like create_custom_field, delete_custom_field, and list_custom_fields, this description unambiguously identifies the action.

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 (e.g., create_custom_field for new fields, delete_custom_field for removal). There is no mention of prerequisites or contexts where updating is appropriate.

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