trend_get
Extract Zabbix trend data for specified item IDs within a defined time range. Provides JSON-formatted results for monitoring and analysis.
Instructions
Get trend data from Zabbix.
Args:
itemids: List of item IDs to get trends for
time_from: Start time (Unix timestamp)
time_till: End time (Unix timestamp)
limit: Maximum number of results
Returns:
str: JSON formatted trend data
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| itemids | Yes | ||
| limit | No | ||
| time_from | No | ||
| time_till | No |
Input Schema (JSON Schema)
{
"properties": {
"itemids": {
"items": {
"type": "string"
},
"title": "Itemids",
"type": "array"
},
"limit": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": null,
"title": "Limit"
},
"time_from": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": null,
"title": "Time From"
},
"time_till": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": null,
"title": "Time Till"
}
},
"required": [
"itemids"
],
"type": "object"
}
Implementation Reference
- src/zabbix_mcp_server.py:882-908 (handler)The main handler function for the 'trend_get' tool, decorated with @mcp.tool() for automatic registration in FastMCP. It retrieves trend data from Zabbix API using the provided itemids and optional time filters, formats the response as JSON.@mcp.tool() def trend_get(itemids: List[str], time_from: Optional[int] = None, time_till: Optional[int] = None, limit: Optional[int] = None) -> str: """Get trend data from Zabbix. Args: itemids: List of item IDs to get trends for time_from: Start time (Unix timestamp) time_till: End time (Unix timestamp) limit: Maximum number of results Returns: str: JSON formatted trend data """ client = get_zabbix_client() params = {"itemids": itemids} if time_from: params["time_from"] = time_from if time_till: params["time_till"] = time_till if limit: params["limit"] = limit result = client.trend.get(**params) return format_response(result)