Skip to main content
Glama
mpeirone

zabbix-mcp-server

user_create

Create and configure new users in Zabbix by specifying username, password, user groups, and personal details. Returns JSON-formatted results for user creation.

Instructions

Create a new user in Zabbix.

Args:
    username: Username
    passwd: Password
    usrgrps: List of user groups (format: [{"usrgrpid": "1"}])
    name: First name
    surname: Last name
    email: Email address
    
Returns:
    str: JSON formatted creation result

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
emailNo
nameNo
passwdYes
surnameNo
usernameYes
usrgrpsYes

Implementation Reference

  • The handler function for the 'user_create' MCP tool. It is registered via the @mcp.tool() decorator and implements user creation in Zabbix using the ZabbixAPI. Includes type-hinted parameters serving as input schema, docstring documentation, read-only validation, parameter construction, API call, and JSON response formatting.
    @mcp.tool()
    def user_create(username: str, passwd: str, usrgrps: List[Dict[str, str]],
                    name: Optional[str] = None, surname: Optional[str] = None,
                    email: Optional[str] = None) -> str:
        """Create a new user in Zabbix.
        
        Args:
            username: Username
            passwd: Password
            usrgrps: List of user groups (format: [{"usrgrpid": "1"}])
            name: First name
            surname: Last name
            email: Email address
            
        Returns:
            str: JSON formatted creation result
        """
        validate_read_only()
        
        client = get_zabbix_client()
        params = {
            "username": username,
            "passwd": passwd,
            "usrgrps": usrgrps
        }
        
        if name:
            params["name"] = name
        if surname:
            params["surname"] = surname
        if email:
            params["email"] = email
        
        result = client.user.create(**params)
        return format_response(result)

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/mpeirone/zabbix-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server