Skip to main content
Glama
Zabbix MCP Server

Zabbix MCP Server

trend_get

Read-only

Retrieve hourly aggregated min, average, and max trend values for Zabbix items over long time ranges. Filter by item IDs and time bounds to get a compact view without pulling full history.

Instructions

Retrieve trend data (hourly aggregated min/avg/max values). Trends are calculated from history and provide a compact, long-term view of metric behaviour. Each record covers a one-hour period and includes the minimum, average, and maximum values as well as the number of values collected. Use trends instead of history for time ranges spanning days or more to reduce data volume. Filter by 'itemids' and use 'time_from' / 'time_till' to bound the time range. The item IDs have to be looked up first with item_get (output itemid, name, key_, value_type, units); only numeric items (value_type 0 or 3) have trends. trend.get cannot sort: the hours come oldest first, so a 'limit' keeps the start of the period; bound the period with 'time_from' / 'time_till' instead.

Input Schema

NameRequiredDescriptionDefault
limitNoMaximum number of results to return.
outputNoProperties of the trend object to return. Pass 'extend' for all, 'count' for the number of matches only, or a list of property names. Default when omitted: 'extend'. Properties: clock, itemid, num, value_avg, value_max, value_min.
serverNoTarget Zabbix server. Available: default. Defaults to 'default' if omitted.
itemidsNoReturn only trend data for the given item IDs (from item_get; never guessed). Needed for a scoped answer: without them the call returns trends of every item.
raw_jsonNoStrips the security disclaimer preamble from the response so it is pure JSON. Default: false. Requires the bearer token to have 'allow_raw_json' explicitly enabled by an operator in the admin portal - tokens without that policy receive a PolicyError instead. WARNING: setting true bypasses the prompt-injection mitigation marker that wraps untrusted Zabbix data (host names, item descriptions, problem text). LLM clients (Claude, GPT, Cursor, ...) should leave this false; only programmatic non-LLM consumers (Python scripts, n8n workflows that json.loads the result) should set true.
time_fromNoReturn only trend data after this time (Unix timestamp, ISO 8601 date-time such as 2026-04-01T08:00:00Z, or a relative time such as now-1h, now/d or now-7d/d; a value without a zone is read in the zone resolved for the call) (inclusive).
time_tillNoReturn only trend data before this time (Unix timestamp, ISO 8601 date-time such as 2026-04-01T08:00:00Z, or a relative time such as now-1h, now/d or now-7d/d; a value without a zone is read in the zone resolved for the call) (inclusive).
countOutputNoReturn the count of matching results instead of the actual data.
extra_paramsNoOther native trend.get parameters, merged into the request as-is. trend.get has no parameters beyond the typed ones. Any other key is refused here, because Zabbix would silently ignore it. For a parameter you are sure exists on your release but is not listed, use zabbix_raw_api_call.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed6 schema fields changedv1.42.2
    • addedInput schema / additionalProperties
      Added value: +false
    • changedInput schema / properties / extra_params / anyOf
      Previous value: -[
      -  {
      -    "additionalProperties": true,
      -    "type": "object"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]New value: +[
      +  {
      +    "additionalProperties": false,
      +    "type": "object"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • changedInput schema / properties / itemids / description
      Previous value: -"Return only trend data for the given item IDs."New value: +"Return only trend data for the given item IDs (from item_get; never guessed). Needed for a scoped answer: without them the call returns trends of every item."
    • changedInput schema / properties / output / anyOf
      Previous value: -[
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]New value: +[
      +  {
      +    "enum": [
      +      "extend",
      +      "count"
      +    ],
      +    "type": "string"
      +  },
      +  {
      +    "items": {
      +      "enum": [
      +        "clock",
      +        "itemid",
      +        "num",
      +        "value_avg",
      +        "value_max",
      +        "value_min"
      +      ],
      +      "type": "string"
      +    },
      +    "minItems": 1,
      +    "type": "array"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • changedInput schema / properties / output / description
      Previous value: -"Properties of the trend object to return. Pass 'extend' for all, 'count' for the number of matches only, or a comma-separated list of property names. Default when omitted: 'extend'. Properties: clock, itemid, num, value_avg, value_max, value_min."New value: +"Properties of the trend object to return. Pass 'extend' for all, 'count' for the number of matches only, or a list of property names. Default when omitted: 'extend'. Properties: clock, itemid, num, value_avg, value_max, value_min."
    • changedOutput schema / (root)
      Previous value: -{
      -  "properties": {
      -    "result": {
      -      "title": "Result",
      -      "type": "string"
      -    }
      -  },
      -  "required": [
      -    "result"
      -  ],
      -  "title": "trend_getOutput",
      -  "type": "object"
      -}New value: +null
  2. First observedv1.41.0

TDQS

A4.5/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare this as a read-only, closed-world operation, so the safety profile is covered. The description adds useful behavior: one record per hour, min/avg/max/count fields, numeric-only item eligibility, oldest-first ordering, and limit semantics. It does not contradict the annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is front-loaded with the core purpose and follows with practical constraints. Every sentence contributes either scope, prerequisite, or a behavioral caveat, with no redundant restatement of the name.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a read-only retrieval tool with no output schema, the description is complete enough to call correctly: it covers record shape, filtering, time bounding, item prerequisites, and major limitations. Nothing essential is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the schema already documents each parameter thoroughly. The description still adds cross-parameter meaning beyond the schema, especially that itemids are needed for a scoped answer, that only numeric items have trends, and that limit interacts with oldest-first ordering.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description gives a specific verb and resource: retrieve hourly aggregated min/avg/max trend data. It explains that trends are a compact long-term view derived from history, which clearly distinguishes this tool from history_get.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It explicitly says to use trends instead of history for time ranges spanning days or more, and it names the item_get prerequisite for item IDs. It also explains scoping with itemids and time_from/time_till and warns that limit keeps the start of the period because trend.get cannot sort.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.