Skip to main content
Glama
deyikong

SendGrid MCP Server

by deyikong

update_custom_field

Modify an existing custom field definition in SendGrid by updating its name using the field ID, allowing you to maintain organized contact data structures.

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 handler function that implements the core logic of the update_custom_field tool by sending a PUT request to the SendGrid API to update the name of an existing 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) }] }; },
  • Zod input schema defining the parameters for the tool: field_id (string) and name (string).
    inputSchema: { field_id: z.string().describe("ID of the custom field to update"), name: z.string().describe("New name for the custom field"), },
  • The update_custom_field tool is registered as a property in the exported contactTools object, which is later spread into the main allTools registry.
    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) }] }; }, },

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