Skip to main content
Glama
Zabbix MCP Server

Zabbix MCP Server

apmtrace_get

Read-only

Retrieves OpenTelemetry APM traces from Zabbix with root span details, durations, status codes, and error counts. Filter by time range, trace IDs, attributes, or duration and page results.

Instructions

Retrieve OpenTelemetry (OTel) APM traces (Zabbix 8.0+): one record per trace, with the service_name and span_name of its root span, duration in nanoseconds (from the start of its first span to the end of its last), status_code, span_count, error_count, has_root_span, resource and span attributes. time_from and time_till are required and bound the start of the trace: of its root span or, for a trace whose root span is not stored (has_root_span 0), of its earliest span. Filter by traceids, resource_attributes / span_attributes conditions, or min_duration / max_duration. Page with limit and offset. Use apmspan_get for the spans of a trace and apmlog_get for its log records. For a user who is not Super admin the result is limited to the data whose resource attributes match an APM filter of one of the user's groups (usergroup 'apm_filters').

Input Schema

NameRequiredDescriptionDefault
limitNoMaximum number of records to return.
filterNoReturn only results whose properties exactly match the given values (a single value or a list of values per key). Example: {"status": 0} or {"status": [0, 1]}. Keys: duration, error_count, events, has_root_span, links, resource_attributes, scope_name, scope_version, service_name, span_attributes, span_count, span_kind, span_name, spanid, status_code, status_message, timestamp, trace_state, traceid. Text properties cannot be filtered; use 'search' for them.
offsetNoNumber of records to skip before returning the result (paging).
outputNoProperties of the apmtrace object to return. Pass 'extend' for all, 'count' for the number of matches only, or a list of property names. Default when omitted: timestamp, traceid, service_name, span_name, duration, status_code, span_count. Properties: duration, error_count, events, has_root_span, links, resource_attributes, scope_name, scope_version, service_name, span_attributes, span_count, span_kind, span_name, spanid, status_code, status_message, timestamp, trace_state, traceid.
searchNoReturn results whose string properties contain the given pattern (case-insensitive; '*' is a wildcard when searchWildcardsEnabled is true). Example: {"name": "web"}. Keys: scope_name, scope_version, service_name, span_kind, span_name, spanid, status_code, status_message, trace_state, traceid.
serverNoTarget Zabbix server. Available: default. Defaults to 'default' if omitted.
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.
traceidsNoReturn only traces with the given IDs.
sortfieldNoSort by one or more of: timestamp, traceid, spanid, trace_state, span_name, span_kind, service_name, scope_name, scope_version, duration, status_code, status_message (a list for several; pair with 'sortorder'). No other property is sortable.
sortorderNoSort order: 'ASC' or 'DESC'.
time_fromYesReturn only traces that started at or after this time (required). Unix timestamp, ISO 8601 date-time or a relative time such as now-1h or now-1d/d.
time_tillYesReturn only traces that started before this time (required). Unix timestamp, ISO 8601 date-time or a relative time such as now or now/d.
extra_paramsNoOther native apmtrace.get parameters, merged into the request as-is. apmtrace.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.
max_durationNoReturn only traces whose root span (the whole trace, where it has no root span) lasted less than this many nanoseconds.
min_durationNoReturn only traces whose root span (the whole trace, where it has no root span) lasted at least this many nanoseconds.
span_attributesNoSpan attributes: Attribute conditions as a list of {"key": ..., "value": ..., "operator": ...} objects; operators: 0 Contains, 1 Equals, 2 Not like, 3 Not equal, 4 Exists, 5 Does not exist. An empty list returns everything.
resource_attributesNoResource attributes: Attribute conditions as a list of {"key": ..., "value": ..., "operator": ...} objects; operators: 0 Contains, 1 Equals, 2 Not like, 3 Not equal, 4 Exists, 5 Does not exist. An empty list returns everything.
span_attributes_evaltypeNoHow the conditions in span_attributes combine: 0 = And/Or (default), 2 = Or.
resource_attributes_evaltypeNoHow the conditions in resource_attributes combine: 0 = And/Or (default), 2 = Or.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed15 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: +[
      +  {
      +    "propertyNames": {
      +      "enum": [
      +        "countOutput",
      +        "excludeSearch",
      +        "searchByAny",
      +        "searchWildcardsEnabled",
      +        "startSearch"
      +      ]
      +    },
      +    "type": "object"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • changedInput schema / properties / filter / anyOf
      Previous value: -[
      -  {
      -    "additionalProperties": true,
      -    "type": "object"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]New value: +[
      +  {
      +    "propertyNames": {
      +      "enum": [
      +        "duration",
      +        "error_count",
      +        "events",
      +        "has_root_span",
      +        "links",
      +        "resource_attributes",
      +        "scope_name",
      +        "scope_version",
      +        "service_name",
      +        "span_attributes",
      +        "span_count",
      +        "span_kind",
      +        "span_name",
      +        "spanid",
      +        "status_code",
      +        "status_message",
      +        "timestamp",
      +        "trace_state",
      +        "traceid"
      +      ]
      +    },
      +    "type": "object"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • changedInput schema / properties / filter / description
      Previous value: -"Return only results whose properties exactly match the given values (a single value or a list of values per key). Example: {\"status\": 0} or {\"status\": [0, 1]}. Keys: duration, error_count, events, links, resource_attributes, scope_name, scope_version, service_name, span_attributes, span_count, span_kind, span_name, spanid, status_code, status_message, timestamp, trace_state, traceid. Text properties cannot be filtered; use 'search' for them."New value: +"Return only results whose properties exactly match the given values (a single value or a list of values per key). Example: {\"status\": 0} or {\"status\": [0, 1]}. Keys: duration, error_count, events, has_root_span, links, resource_attributes, scope_name, scope_version, service_name, span_attributes, span_count, span_kind, span_name, spanid, status_code, status_message, timestamp, trace_state, traceid. Text properties cannot be filtered; use 'search' for them."
    • changedInput schema / properties / max_duration / description
      Previous value: -"Return only traces whose root span lasted less than this many nanoseconds."New value: +"Return only traces whose root span (the whole trace, where it has no root span) lasted less than this many nanoseconds."
    • changedInput schema / properties / min_duration / description
      Previous value: -"Return only traces whose root span lasted at least this many nanoseconds."New value: +"Return only traces whose root span (the whole trace, where it has no root span) lasted at least this many nanoseconds."
    • changedInput schema / properties / output / anyOf
      Previous value: -[
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]New value: +[
      +  {
      +    "enum": [
      +      "extend",
      +      "count"
      +    ],
      +    "type": "string"
      +  },
      +  {
      +    "items": {
      +      "enum": [
      +        "duration",
      +        "error_count",
      +        "events",
      +        "has_root_span",
      +        "links",
      +        "resource_attributes",
      +        "scope_name",
      +        "scope_version",
      +        "service_name",
      +        "span_attributes",
      +        "span_count",
      +        "span_kind",
      +        "span_name",
      +        "spanid",
      +        "status_code",
      +        "status_message",
      +        "timestamp",
      +        "trace_state",
      +        "traceid"
      +      ],
      +      "type": "string"
      +    },
      +    "minItems": 1,
      +    "type": "array"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • changedInput schema / properties / output / description
      Previous value: -"Properties of the apmtrace 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: timestamp, traceid, service_name, span_name, duration, status_code, span_count. Properties: duration, error_count, events, links, resource_attributes, scope_name, scope_version, service_name, span_attributes, span_count, span_kind, span_name, spanid, status_code, status_message, timestamp, trace_state, traceid."New value: +"Properties of the apmtrace object to return. Pass 'extend' for all, 'count' for the number of matches only, or a list of property names. Default when omitted: timestamp, traceid, service_name, span_name, duration, status_code, span_count. Properties: duration, error_count, events, has_root_span, links, resource_attributes, scope_name, scope_version, service_name, span_attributes, span_count, span_kind, span_name, spanid, status_code, status_message, timestamp, trace_state, traceid."
    • changedInput schema / properties / search / anyOf
      Previous value: -[
      -  {
      -    "additionalProperties": true,
      -    "type": "object"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]New value: +[
      +  {
      +    "propertyNames": {
      +      "enum": [
      +        "scope_name",
      +        "scope_version",
      +        "service_name",
      +        "span_kind",
      +        "span_name",
      +        "spanid",
      +        "status_code",
      +        "status_message",
      +        "trace_state",
      +        "traceid"
      +      ]
      +    },
      +    "type": "object"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • changedInput schema / properties / sortfield / anyOf
      Previous value: -[
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]New value: +[
      +  {
      +    "enum": [
      +      "timestamp",
      +      "traceid",
      +      "spanid",
      +      "trace_state",
      +      "span_name",
      +      "span_kind",
      +      "service_name",
      +      "scope_name",
      +      "scope_version",
      +      "duration",
      +      "status_code",
      +      "status_message"
      +    ],
      +    "type": "string"
      +  },
      +  {
      +    "items": {
      +      "enum": [
      +        "timestamp",
      +        "traceid",
      +        "spanid",
      +        "trace_state",
      +        "span_name",
      +        "span_kind",
      +        "service_name",
      +        "scope_name",
      +        "scope_version",
      +        "duration",
      +        "status_code",
      +        "status_message"
      +      ],
      +      "type": "string"
      +    },
      +    "minItems": 1,
      +    "type": "array"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • changedInput schema / properties / sortfield / description
      Previous value: -"Sort by one or more of: timestamp, traceid, spanid, trace_state, span_name, span_kind, service_name, scope_name, scope_version, duration, status_code, status_message (comma-separated for several; pair with 'sortorder'). No other property is sortable."New value: +"Sort by one or more of: timestamp, traceid, spanid, trace_state, span_name, span_kind, service_name, scope_name, scope_version, duration, status_code, status_message (a list for several; pair with 'sortorder'). No other property is sortable."
    • changedInput schema / properties / sortorder / anyOf
      Previous value: -[
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]New value: +[
      +  {
      +    "enum": [
      +      "ASC",
      +      "DESC"
      +    ],
      +    "type": "string"
      +  },
      +  {
      +    "items": {
      +      "enum": [
      +        "ASC",
      +        "DESC"
      +      ],
      +      "type": "string"
      +    },
      +    "minItems": 1,
      +    "type": "array"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • changedInput schema / properties / time_from / description
      Previous value: -"Return only traces whose root span started at or after this time (required). Unix timestamp, ISO 8601 date-time or a relative time such as now-1h or now-1d/d."New value: +"Return only traces that started at or after this time (required). Unix timestamp, ISO 8601 date-time or a relative time such as now-1h or now-1d/d."
    • changedInput schema / properties / time_till / description
      Previous value: -"Return only traces whose root span started before this time (required). Unix timestamp, ISO 8601 date-time or a relative time such as now or now/d."New value: +"Return only traces that started before this time (required). Unix timestamp, ISO 8601 date-time or a relative time such as now or now/d."
    • changedOutput schema / (root)
      Previous value: -{
      -  "properties": {
      -    "result": {
      -      "title": "Result",
      -      "type": "string"
      -    }
      -  },
      -  "required": [
      -    "result"
      -  ],
      -  "title": "apmtrace_getOutput",
      -  "type": "object"
      -}New value: +null
  2. First observedv1.41.0

TDQS

A4.3/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true and openWorldHint=false, so the description's added value is the permission-scoping behavior: non-Super-admin results are intersected with the APM filters of the user's groups. It also discloses the non-obvious timing semantics for traces without a stored root span (time bounds fall back to the earliest span). It stops short of discussing result caps or the raw_json policy, which live in the schema.

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

Conciseness4/5

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

Front-loaded with the record shape, then filtering modes, then sibling routing, then the permission caveat — a sensible order with no filler sentences. It is dense for a single paragraph and repeats a few details (duration unit, root-span fallback) that also appear in parameter descriptions, but nothing is wasted.

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

Completeness4/5

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

For a 19-parameter tool with no output schema, the description supplies the essential record contents and the time/paging/filtering model, plus the access-control caveat. Remaining details (sorting, output projection, search wildcarding) are fully covered by the schema, so an agent can call this correctly from the description plus schema.

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

Parameters3/5

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

Schema description coverage is 100%, so the schema already documents filter, search, output, sortfield and the attribute operators in detail. The description adds only a high-level grouping of the filtering modes and the nanosecond unit for duration, which the schema also states. Baseline 3 is appropriate when the schema does the heavy lifting.

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?

Names a specific verb+resource (retrieve OTel APM traces) and immediately enumerates the record shape: root span service_name/span_name, duration in nanoseconds, status_code, span_count, error_count, has_root_span, and attributes. It also names the siblings it is not (apmspan_get for spans, apmlog_get for logs), so an agent can distinguish it without opening any schema.

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?

Explicitly states when to reach for the alternatives ('Use apmspan_get for the spans of a trace and apmlog_get for its log records') and describes the available narrowing strategies (traceids, attribute conditions, min/max duration, limit/offset paging). It also states that time_from/time_till are required and how they bind, which is the main precondition for calling it.

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