Skip to main content
Glama

Query Prometheus range

query_prometheus_range
Read-only

Execute a PromQL range query over a time window: the tool for trends, usage over time, restarts in a period and spike detection. The platform metrics store answers first and needs no connected Prometheus: it holds the Ankra agent's ankra_* series (ankra_node_cpu_usage_cores, ankra_node_memory_working_set_bytes, ankra_namespace_pod_restarts, ankra_workload_pod_restarts and the rest named in query_prometheus). cAdvisor and kube-state-metrics names answer only from a Prometheus connected in Cluster Settings > Metrics. Results are automatically truncated to fit context limits.

Input Schema

NameRequiredDescriptionDefault
stepNoResolution step (e.g. '30s', '1m', '5m'). Auto-calculated from duration if omitted.
queryYesPromQL query string (max 2000 chars).
durationNoLookback duration from now (e.g. '15m', '1h', '6h', '24h', '7d'). Defaults to '1h'.1h
cluster_idYesAnkra cluster id (UUID) the call targets. Discover ids with list_clusters.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.1/5.0
Behavior5/5

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

Beyond readOnlyHint=true, the description discloses non-obvious behavior: the platform metrics store answers first without any connected Prometheus, foreign metric names only resolve when a Prometheus source is connected, and results are automatically truncated to fit context limits. That truncation warning is exactly the kind of behavioral caveat an agent needs before interpreting a partial result.

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 core action and use cases before the data-source caveats, which is the right ordering. The enumerated ankra_* series names are somewhat verbose but serve to make the source distinction concrete.

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?

With no output schema, the description covers the most important return-side fact (automatic truncation) and the data-source prerequisites. It stops short of describing the shape of returned series (timestamps/values) or what an empty result means, leaving a modest gap.

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 query, duration, step and cluster_id are already fully documented with examples and defaults. The description adds context about which series names are valid inside `query`, but nothing about duration/step syntax or interaction beyond the schema, so baseline 3 applies.

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: 'Execute a PromQL range query over a time window', then names concrete use cases (trends, usage over time, restarts in a period, spike detection). It references the sibling query_prometheus only as the place where series names are listed, so the range-vs-instant split is implied rather than stated outright.

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 conditions for use (trends, over-time usage, restarts within a period, spike detection) and, importantly, states which data source answers which metric names and that cAdvisor/kube-state-metrics names require a Prometheus connected in Cluster Settings > Metrics. There is no explicit exclusion pointing to query_prometheus for single-point queries, so the alternative routing is only implied.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.