create_group
Create a new group in Zendesk by specifying a group name and optional description to organize users, tickets, and workflows effectively.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| description | No | Group description | |
| name | Yes | Group name |
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"description": {
"description": "Group description",
"type": "string"
},
"name": {
"description": "Group name",
"type": "string"
}
},
"required": [
"name"
],
"type": "object"
}
Implementation Reference
- src/tools/groups.js:60-80 (handler)The MCP tool handler function for 'create_group' that prepares the group data, calls the Zendesk client, and formats the success or error response.handler: async ({ name, description }) => { try { const groupData = { name, description }; const result = await zendeskClient.createGroup(groupData); return { content: [{ type: "text", text: `Group created successfully!\n\n${JSON.stringify(result, null, 2)}` }] }; } catch (error) { return { content: [{ type: "text", text: `Error creating group: ${error.message}` }], isError: true }; } }
- src/tools/groups.js:56-59 (schema)Input schema for the 'create_group' tool using Zod validation for name (required string) and optional description.schema: { name: z.string().describe("Group name"), description: z.string().optional().describe("Group description") },
- src/tools/groups.js:53-81 (registration)The complete 'create_group' tool object definition, including name, description, schema, and handler, as part of the exported groupsTools array.{ name: "create_group", description: "Create a new agent group", schema: { name: z.string().describe("Group name"), description: z.string().optional().describe("Group description") }, handler: async ({ name, description }) => { try { const groupData = { name, description }; const result = await zendeskClient.createGroup(groupData); return { content: [{ type: "text", text: `Group created successfully!\n\n${JSON.stringify(result, null, 2)}` }] }; } catch (error) { return { content: [{ type: "text", text: `Error creating group: ${error.message}` }], isError: true }; } } },
- src/server.js:48-52 (registration)Dynamic registration loop that registers the 'create_group' tool (via groupsTools) to the MCP server.allTools.forEach((tool) => { server.tool(tool.name, tool.schema, tool.handler, { description: tool.description, }); });
- src/zendesk-client.js:153-155 (helper)Helper method in ZendeskClient that performs the actual API POST request to create a group.async createGroup(data) { return this.request("POST", "/groups.json", { group: data }); }