user_get
Retrieve users from Zabbix with optional filtering by user IDs, search criteria, or custom filters. Returns a JSON-formatted list of users for streamlined integration and analysis.
Instructions
Get users from Zabbix with optional filtering.
Args:
userids: List of user IDs to retrieve
output: Output format
search: Search criteria
filter: Filter criteria
Returns:
str: JSON formatted list of users
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| filter | No | ||
| output | No | extend | |
| search | No | ||
| userids | No |
Input Schema (JSON Schema)
{
"properties": {
"filter": {
"anyOf": [
{
"additionalProperties": true,
"type": "object"
},
{
"type": "null"
}
],
"default": null,
"title": "Filter"
},
"output": {
"default": "extend",
"title": "Output",
"type": "string"
},
"search": {
"anyOf": [
{
"additionalProperties": {
"type": "string"
},
"type": "object"
},
{
"type": "null"
}
],
"default": null,
"title": "Search"
},
"userids": {
"anyOf": [
{
"items": {
"type": "string"
},
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"title": "Userids"
}
},
"type": "object"
}
Implementation Reference
- src/zabbix_mcp_server.py:913-939 (handler)The main handler function for the 'user_get' tool. It is decorated with @mcp.tool(), which registers it as an MCP tool. The function retrieves users from the Zabbix API using the pyzabbix client, applies optional filters, and returns a formatted JSON response.def user_get(userids: Optional[List[str]] = None, output: Union[str, List[str]] = "extend", search: Optional[Dict[str, str]] = None, filter: Optional[Dict[str, Any]] = None) -> str: """Get users from Zabbix with optional filtering. Args: userids: List of user IDs to retrieve output: Output format (extend or list of specific fields) search: Search criteria filter: Filter criteria Returns: str: JSON formatted list of users """ client = get_zabbix_client() params = {"output": output} if userids: params["userids"] = userids if search: params["search"] = search if filter: params["filter"] = filter result = client.user.get(**params) return format_response(result)