list_groups
Retrieve and manage Zendesk support groups with pagination controls to organize customer service workflows and team assignments.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| page | No | Page number for pagination | |
| per_page | No | Number of groups per page (max 100) |
Implementation Reference
- src/tools/groups.js:12-27 (handler)The main handler function for the 'list_groups' tool. It constructs parameters, calls the Zendesk client to list groups, formats the result as JSON text, or returns an error message.handler: async ({ page, per_page }) => { try { const params = { page, per_page }; const result = await zendeskClient.listGroups(params); return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] }; } catch (error) { return { content: [{ type: "text", text: `Error listing groups: ${error.message}` }], isError: true }; }
- src/tools/groups.js:8-11 (schema)Zod schema defining optional input parameters 'page' and 'per_page' for pagination.schema: { page: z.number().optional().describe("Page number for pagination"), per_page: z.number().optional().describe("Number of groups per page (max 100)") },
- src/server.js:48-52 (registration)Registration of all tools, including 'list_groups' from groupsTools, by dynamically calling server.tool() for each tool in the allTools array.allTools.forEach((tool) => { server.tool(tool.name, tool.schema, tool.handler, { description: tool.description, }); });
- src/zendesk-client.js:145-146 (helper)ZendeskClient helper method that performs the actual API GET request to list groups.async listGroups(params) { return this.request("GET", "/groups.json", null, params);
- src/server.js:35-35 (registration)Inclusion of groupsTools (containing list_groups) into the allTools array for registration....groupsTools,