getGroups
Retrieve all user groups or lists with a customizable limit for better organization and access to contacts across platforms like email, social media, and messaging apps.
Instructions
Get all groups or lists for the user.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | The maximum number of groups to return. |
Implementation Reference
- index.js:262-262 (handler)Handler/execute function for the getGroups tool, which proxies the call to the external /get-groups endpoint using the callTool helper.
execute: async (params) => callTool("/get-groups", params), - index.js:256-261 (schema)Input schema for getGroups tool using Zod, defining optional 'limit' parameter.
parameters: z.object({ limit: z .number() .describe("The maximum number of groups to return.") .optional(), }), - index.js:253-263 (registration)Registration of the getGroups MCP tool via FastMCP server.addTool.
server.addTool({ name: "getGroups", description: "Get all groups or lists for the user.", parameters: z.object({ limit: z .number() .describe("The maximum number of groups to return.") .optional(), }), execute: async (params) => callTool("/get-groups", params), }); - index.js:31-41 (helper)Helper function used by getGroups (and other tools) to proxy requests to the external Clay API at nexum.clay.earth.
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()); }