Skip to main content
Glama

query_metrics

Read-only

Query Dynatrace metrics over a time range and return per-series min, max, average, and last values; optionally include every datapoint for deeper analysis.

Instructions

Query metric data (GET /api/v2/metrics/query) with per-series min/max/avg/last. Needs metrics.read.

Input Schema

NameRequiredDescriptionDefault
to_timeNoEnd: now, ISO-8601 or epoch msnow
from_timeNoStart: now-2h, ISO-8601 (2026-10-31T10:00:00Z) or epoch msnow-2h
resolutionNoe.g. 1m, 5m, 1h, Inf; empty = automatic
mz_selectorNoManagement zone, e.g. mzName("Prod")
entity_selectorNoLimit to these entities
metric_selectorYese.g. builtin:service.response.time:avg or builtin:host.cpu.usage:splitBy("dt.entity.host"):max
include_datapointsNoReturn every timestamp/value, not only the summary

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.8/5.0
Behavior4/5

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

Annotations already cover read-only/open-world safety, and the description adds real context on top: the underlying GET endpoint, the required metrics.read permission, and the shape of the aggregation returned. It stops short of covering pagination, rate limits, or what happens when a selector matches nothing.

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?

Two compact sentences, front-loaded with the action and the result shape, then the permission requirement. No filler and nothing repeated from the schema.

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 7-parameter read tool with full schema coverage, the description supplies what structured fields cannot: the permission prerequisite and the per-series aggregate return format despite there being no output schema. Missing only edge-case behavior such as empty result sets or large-range limits.

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 every parameter including selector syntax examples is already documented, making 3 the baseline. The description's only added semantic is that results are per-series aggregates, which loosely explains the include_datapoints summary-vs-full behavior already described in the schema.

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

Purpose4/5

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

States a specific verb and resource (query metric data) and pins down the return shape as per-series min/max/avg/last, which separates it from list_metrics/get_metric_descriptor in the sibling set. It never names those alternatives explicitly, so differentiation is inferred rather than stated.

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

Usage Guidelines3/5

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

Usage is implied by 'Query metric data' plus the summary statistics, and the 'Needs metrics.read' clause flags a prerequisite. There is no explicit when-to-use/when-not guidance and no mention of list_metrics or get_metric_descriptor as the alternatives for descriptor discovery versus data retrieval.

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