Skip to main content
Glama
initMAX

Zabbix MCP Server

apmspan_get

Read-only

Retrieve OpenTelemetry APM spans from Zabbix traces by required time range, trace ID, span ID, attributes, or duration; page results with limit and offset.

Instructions

Retrieve OpenTelemetry (OTel) APM spans (Zabbix 8.0+): the individual operations inside traces, with parent_spanid, span_kind, duration in nanoseconds, status, events and links. time_from and time_till are required and bound the span start. Filter by traceids (all spans of a trace), spanids, parent_spanids, attribute conditions or duration. Page with limit and offset.

Input Schema

TableJSON 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, events, links, parent_spanid, resource_attributes, scope_name, scope_version, service_name, span_attributes, 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 apmspan 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, spanid, parent_spanid, service_name, span_name, duration, status_code. Properties: duration, events, links, parent_spanid, resource_attributes, scope_name, scope_version, service_name, span_attributes, 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: parent_spanid, 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.
spanidsNoReturn only spans with the given IDs.
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 spans that belong to the given traces.
sortfieldNoSort by one or more of: timestamp, traceid, spanid, parent_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.
sortorderNoSort order: 'ASC' or 'DESC'.
time_fromYesReturn only spans 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 spans 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 apmspan.get parameters, merged into the request as-is. apmspan.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 spans that lasted less than this many nanoseconds.
min_durationNoReturn only spans that lasted at least this many nanoseconds.
parent_spanidsNoReturn only spans whose parent span has one of the given IDs.
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.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.41.0

TDQS

A4/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=true and openWorldHint=true, so the safety profile is covered; the description adds the required time-bound behavior and the shape of a span (parent_spanid, span_kind, nanosecond duration, events, links). It does not discuss pagination defaults, result caps, or the untrusted-data handling that the raw_json parameter warns about, so it adds only moderate context beyond structured fields.

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?

Four sentences, purpose front-loaded, then required bounds, then filter axes, then paging — each sentence earns its place with no filler or repetition. The ordering matches how an agent would build the call.

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 21-parameter read tool with full schema coverage, an output schema, and read-only annotations, the description covers what it is, what is required, and how to narrow results — enough to call it correctly. Only the absence of any sibling routing (trace vs span vs log) keeps it short of complete.

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% and every parameter carries a detailed description (operators, evaltype values, sortable fields, output presets), so the schema does the heavy lifting. The description restates the filter and paging groups but adds no syntax, defaults, or semantics not already present in the schema, which is the expected baseline-3 case.

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?

States a specific verb+resource ('Retrieve OpenTelemetry (OTel) APM spans') and immediately scopes it as 'the individual operations inside traces', which cleanly separates it from the sibling apmtrace_get (whole traces). It also names the product version (Zabbix 8.0+) and the fields that identify a span, so an agent can tell what it gets back without opening the schema.

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

Usage Guidelines4/5

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

Gives clear operating context: time_from/time_till are mandatory and bound span start time, and it enumerates the filter axes (traceids, spanids, parent_spanids, attribute conditions, duration) plus paging via limit/offset. It never explicitly says when to prefer this over apmtrace_get or apmlog_get, so the routing is implied rather than stated.

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