delete_custom_field
Remove a custom field definition from SendGrid contact management by specifying its ID to clean up unused data fields.
Instructions
Delete a custom field definition
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| field_id | Yes | ID of the custom field to delete |
Implementation Reference
- src/tools/contacts.ts:242-252 (handler)The handler function for the 'delete_custom_field' tool. It checks read-only mode and sends a DELETE request to the SendGrid API to delete the custom field.handler: async ({ field_id }: { field_id: 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: "DELETE", }); return { content: [{ type: "text", text: `Custom field ${field_id} deleted successfully.` }] }; },
- src/tools/contacts.ts:238-240 (schema)Input schema using Zod for the delete_custom_field tool, defining the required field_id parameter.inputSchema: { field_id: z.string().describe("ID of the custom field to delete"), },
- src/tools/contacts.ts:234-253 (registration)Tool registration within contactTools object, defining config (including schema) and handler for delete_custom_field.delete_custom_field: { config: { title: "Delete Custom Field", description: "Delete a custom field definition", inputSchema: { field_id: z.string().describe("ID of the custom field to delete"), }, }, handler: async ({ field_id }: { field_id: 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: "DELETE", }); return { content: [{ type: "text", text: `Custom field ${field_id} deleted successfully.` }] }; }, },