updateGroup
Modify group details or memberships in Clay's MCP server. Update group titles, add or remove multiple contact IDs in a single operation to streamline group management.
Instructions
Update a group or list. Use this to update the group title and/or modify its members. When adding or removing contacts, provide ALL contact IDs to add/remove in a single call - do not make multiple calls for individual contacts.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| add_contact_ids | No | A list of contact IDs that should be added to this group. Each ID should be a number representing an existing contact in your network. You can provide multiple IDs to add several contacts at once. | |
| group_id | Yes | The ID of the group or list to update. | |
| remove_contact_ids | No | A list of contact IDs that should be removed from this group. Each ID should be a number representing an existing contact in your network. You can provide multiple IDs to remove several contacts at once. | |
| title | No | The new name of the group if the user wants to rename it. |
Implementation Reference
- index.js:298-298 (handler)The handler function for the 'updateGroup' tool. It proxies the input parameters to an external API endpoint '/update-group' using the shared callTool helper.execute: async (params) => callTool("/update-group", params),
- index.js:279-297 (schema)Zod input schema for the 'updateGroup' tool defining parameters: group_id (number, required), title (string, optional), add_contact_ids (array of numbers, default []), remove_contact_ids (array of numbers, default []).parameters: z.object({ group_id: z.number().describe("The ID of the group or list to update."), title: z .string() .describe("The new name of the group if the user wants to rename it.") .optional(), add_contact_ids: z .array(z.number()) .describe( "A list of contact IDs that should be added to this group. Each ID should be a number representing an existing contact in your network. You can provide multiple IDs to add several contacts at once." ) .default([]), remove_contact_ids: z .array(z.number()) .describe( "A list of contact IDs that should be removed from this group. Each ID should be a number representing an existing contact in your network. You can provide multiple IDs to remove several contacts at once." ) .default([]), }),
- index.js:275-299 (registration)Full registration of the 'updateGroup' MCP tool with FastMCP server, including name, description, input schema, and proxy execute handler.server.addTool({ name: "updateGroup", description: "Update a group or list. Use this to update the group title and/or modify its members. When adding or removing contacts, provide ALL contact IDs to add/remove in a single call - do not make multiple calls for individual contacts.", parameters: z.object({ group_id: z.number().describe("The ID of the group or list to update."), title: z .string() .describe("The new name of the group if the user wants to rename it.") .optional(), add_contact_ids: z .array(z.number()) .describe( "A list of contact IDs that should be added to this group. Each ID should be a number representing an existing contact in your network. You can provide multiple IDs to add several contacts at once." ) .default([]), remove_contact_ids: z .array(z.number()) .describe( "A list of contact IDs that should be removed from this group. Each ID should be a number representing an existing contact in your network. You can provide multiple IDs to remove several contacts at once." ) .default([]), }), execute: async (params) => callTool("/update-group", params), });
- index.js:31-41 (helper)Shared utility function used by all proxy tools, including updateGroup, to make authenticated POST requests to the external Clay API backend.async function callTool(path, params, session) { console.log('Calling tool', path, session) return fetch(`https://nexum.clay.earth/tools${path}`, { body: JSON.stringify(params), headers: { Authorization: `ApiKey ${session.apiKey}`, "Content-Type": "application/json", }, method: "POST", }).then((res) => res.text()); }