Skip to main content
Glama

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
Behavior4/5

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

readOnlyHint=true already tells the agent this is a safe read, and the description adds real behavioral facts: automatic result truncation to fit context limits, and that data sources are conditional on whether a Prometheus is connected. It says nothing about rate limits, timeouts, or failure modes when a series is absent.

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?

Three dense sentences, front-loaded with the verb and primary use cases before qualifying the data-source conditions. Every sentence carries information, though the long parenthetical series list is heavier than it needs to be for a description.

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?

No output schema exists, but PromQL range results are a well-known matrix shape, so omitting the return format is acceptable. Data-source availability and context truncation — the two behaviors most likely to surprise an agent — are both covered, leaving only minor gaps around failure handling.

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 all self-documented, and the description adds only indirect guidance on what the query string may reference (the ankra_* series). Useful context, but it does not clarify parameter interaction — e.g. how step relates to duration — so the baseline 3 is appropriate.

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 and resource — 'Execute a PromQL range query over a time window' — and enumerates the analytic intents it serves (trends, usage over time, restarts in a period, spike detection). The contrast with the sibling query_prometheus (which is cited as the place series are named) makes the range-vs-instant distinction inferable without opening either 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 positive usage contexts (trends, spike detection, restarts over a period) and a valuable routing rule: the platform metrics store answers first, while cAdvisor/kube-state-metrics names only resolve from a Prometheus connected in Cluster Settings > Metrics. It never states the explicit exclusion (e.g. 'use query_prometheus for a single point-in-time value'), so it stops short of a full when/when-not statement.

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.

Resources