create_user
Add new users to Zendesk with name, email, role, and contact details to manage customer support accounts.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | User's full name | |
| Yes | User's email address | ||
| role | No | User's role | |
| phone | No | User's phone number | |
| organization_id | No | ID of the user's organization | |
| tags | No | Tags for the user | |
| notes | No | Notes about the user |
Implementation Reference
- src/tools/users.js:66-90 (handler)MCP tool handler for 'create_user' that constructs user data from inputs and delegates to zendeskClient.createUser, handling success/error responses.handler: async ({ name, email, role, phone, organization_id, tags, notes }) => { try { const userData = { name, email, role, phone, organization_id, tags, notes }; const result = await zendeskClient.createUser(userData); return { content: [{ type: "text", text: `User created successfully!\n\n${JSON.stringify(result, null, 2)}` }] }; } catch (error) { return { content: [{ type: "text", text: `Error creating user: ${error.message}` }], isError: true }; }
- src/tools/users.js:57-65 (schema)Zod schema defining the input parameters and validation for the 'create_user' tool.schema: { name: z.string().describe("User's full name"), email: z.string().email().describe("User's email address"), role: z.enum(["end-user", "agent", "admin"]).optional().describe("User's role"), phone: z.string().optional().describe("User's phone number"), organization_id: z.number().optional().describe("ID of the user's organization"), tags: z.array(z.string()).optional().describe("Tags for the user"), notes: z.string().optional().describe("Notes about the user") },
- src/server.js:48-52 (registration)Dynamic registration of all tools, including 'create_user' from usersTools, to the MCP server via server.tool() calls.allTools.forEach((tool) => { server.tool(tool.name, tool.schema, tool.handler, { description: tool.description, }); });
- src/zendesk-client.js:109-110 (helper)ZendeskClient helper method invoked by the tool handler to perform the actual API POST request to create a user.async createUser(data) { return this.request("POST", "/users.json", { user: data });