trigger_get
Retrieve Zabbix triggers with flexible filtering by trigger, host, group, or template IDs, and customize output in JSON format for precise monitoring data extraction.
Instructions
Get triggers from Zabbix with optional filtering.
Args:
triggerids: List of trigger IDs to retrieve
hostids: List of host IDs to filter by
groupids: List of host group IDs to filter by
templateids: List of template IDs to filter by
output: Output format
search: Search criteria
filter: Filter criteria
limit: Maximum number of results
Returns:
str: JSON formatted list of triggers
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| filter | No | ||
| groupids | No | ||
| hostids | No | ||
| limit | No | ||
| output | No | extend | |
| search | No | ||
| templateids | No | ||
| triggerids | No |
Implementation Reference
- src/zabbix_mcp_server.py:463-506 (handler)The trigger_get tool handler: decorated with @mcp.tool() which registers it with FastMCP, implements retrieval of Zabbix triggers via API with filtering options, formats response as JSON.@mcp.tool() def trigger_get(triggerids: Optional[List[str]] = None, hostids: Optional[List[str]] = None, groupids: Optional[List[str]] = None, templateids: Optional[List[str]] = None, output: Union[str, List[str]] = "extend", search: Optional[Dict[str, str]] = None, filter: Optional[Dict[str, Any]] = None, limit: Optional[int] = None) -> str: """Get triggers from Zabbix with optional filtering. Args: triggerids: List of trigger IDs to retrieve hostids: List of host IDs to filter by groupids: List of host group IDs to filter by templateids: List of template IDs to filter by output: Output format (extend or list of specific fields) search: Search criteria filter: Filter criteria limit: Maximum number of results Returns: str: JSON formatted list of triggers """ client = get_zabbix_client() params = {"output": output} if triggerids: params["triggerids"] = triggerids if hostids: params["hostids"] = hostids if groupids: params["groupids"] = groupids if templateids: params["templateids"] = templateids if search: params["search"] = search if filter: params["filter"] = filter if limit: params["limit"] = limit result = client.trigger.get(**params) return format_response(result)