user_update
Modify user details in Zabbix by updating username, name, surname, or email using the specified user ID. Returns JSON-formatted update results for streamlined user management.
Instructions
Update an existing user in Zabbix.
Args:
userid: User ID to update
username: New username
name: New first name
surname: New last name
email: New email address
Returns:
str: JSON formatted update result
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| No | |||
| name | No | ||
| surname | No | ||
| userid | Yes | ||
| username | No |
Input Schema (JSON Schema)
{
"properties": {
"email": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Email"
},
"name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Name"
},
"surname": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Surname"
},
"userid": {
"title": "Userid",
"type": "string"
},
"username": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Username"
}
},
"required": [
"userid"
],
"type": "object"
}
Implementation Reference
- src/zabbix_mcp_server.py:979-1010 (handler)The `user_update` MCP tool implementation. This function is decorated with `@mcp.tool()` which registers it as an MCP tool named 'user_update'. It handles updating Zabbix user information (username, name, surname, email) using the Zabbix API client, with read-only validation and JSON response formatting.@mcp.tool() def user_update(userid: str, username: Optional[str] = None, name: Optional[str] = None, surname: Optional[str] = None, email: Optional[str] = None) -> str: """Update an existing user in Zabbix. Args: userid: User ID to update username: New username name: New first name surname: New last name email: New email address Returns: str: JSON formatted update result """ validate_read_only() client = get_zabbix_client() params = {"userid": userid} if username: params["username"] = username if name: params["name"] = name if surname: params["surname"] = surname if email: params["email"] = email result = client.user.update(**params) return format_response(result)