update_user
Modify user details in Zendesk by updating name, email, role, phone, organization, tags, or notes using the Zendesk API MCP Server.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| No | Updated email address | ||
| id | Yes | User ID to update | |
| name | No | Updated user's name | |
| notes | No | Updated notes about the user | |
| organization_id | No | Updated organization ID | |
| phone | No | Updated phone number | |
| role | No | Updated user's role | |
| tags | No | Updated tags for the user |
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"email": {
"description": "Updated email address",
"format": "email",
"type": "string"
},
"id": {
"description": "User ID to update",
"type": "number"
},
"name": {
"description": "Updated user's name",
"type": "string"
},
"notes": {
"description": "Updated notes about the user",
"type": "string"
},
"organization_id": {
"description": "Updated organization ID",
"type": "number"
},
"phone": {
"description": "Updated phone number",
"type": "string"
},
"role": {
"description": "Updated user's role",
"enum": [
"end-user",
"agent",
"admin"
],
"type": "string"
},
"tags": {
"description": "Updated tags for the user",
"items": {
"type": "string"
},
"type": "array"
}
},
"required": [
"id"
],
"type": "object"
}
Implementation Reference
- src/tools/users.js:106-131 (handler)The handler function for the 'update_user' tool. It conditionally constructs a userData object from provided optional parameters and delegates the API call to zendeskClient.updateUser, handling success and error responses.handler: async ({ id, name, email, role, phone, organization_id, tags, notes }) => { try { const userData = {}; if (name !== undefined) userData.name = name; if (email !== undefined) userData.email = email; if (role !== undefined) userData.role = role; if (phone !== undefined) userData.phone = phone; if (organization_id !== undefined) userData.organization_id = organization_id; if (tags !== undefined) userData.tags = tags; if (notes !== undefined) userData.notes = notes; const result = await zendeskClient.updateUser(id, userData); return { content: [{ type: "text", text: `User updated successfully!\n\n${JSON.stringify(result, null, 2)}` }] }; } catch (error) { return { content: [{ type: "text", text: `Error updating user: ${error.message}` }], isError: true }; } }
- src/tools/users.js:96-105 (schema)Zod schema defining the input parameters for the 'update_user' tool, including required user ID and optional fields for update.schema: { id: z.number().describe("User ID to update"), name: z.string().optional().describe("Updated user's name"), email: z.string().email().optional().describe("Updated email address"), role: z.enum(["end-user", "agent", "admin"]).optional().describe("Updated user's role"), phone: z.string().optional().describe("Updated phone number"), organization_id: z.number().optional().describe("Updated organization ID"), tags: z.array(z.string()).optional().describe("Updated tags for the user"), notes: z.string().optional().describe("Updated notes about the user") },
- src/server.js:48-52 (registration)Dynamic registration of all tools, including 'update_user' from usersTools, by iterating over allTools and calling server.tool(name, schema, handler).allTools.forEach((tool) => { server.tool(tool.name, tool.schema, tool.handler, { description: tool.description, }); });
- src/zendesk-client.js:113-115 (helper)Helper method in ZendeskClient that performs the actual PUT request to the Zendesk API to update a user.async updateUser(id, data) { return this.request("PUT", `/users/${id}.json`, { user: data }); }