update_user
Modify user account details including username, password, or role permissions in Umami Analytics. Requires admin access to update user profiles.
Instructions
Update a user's username, password, or role (admin only)
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| userId | Yes | User UUID | |
| username | No | New username | |
| password | No | New password | |
| role | No | New role: 'admin' or 'user' |
Implementation Reference
- src/tools/users.ts:54-71 (handler)The 'update_user' tool is registered and implemented in 'src/tools/users.ts'. The registration includes the schema definition via Zod and the async handler function that calls the Umami API.
server.tool( "update_user", "Update a user's username, password, or role (admin only)", { userId: z.string().describe("User UUID"), username: z.string().optional().describe("New username"), password: z.string().optional().describe("New password"), role: z.string().optional().describe("New role: 'admin' or 'user'"), }, async ({ userId, username, password, role }) => { const body: Record<string, unknown> = {}; if (username !== undefined) body.username = username; if (password !== undefined) body.password = password; if (role !== undefined) body.role = role; const data = await client.call("POST", `/api/users/${userId}`, body); return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] }; } );