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.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "query": "<query>",
      "cluster_id": "<cluster_id>"
    },
    "name": "query_prometheus_range"
  }
}

Input Schema

NameRequiredDescriptionDefault
stepNoResolution step: a duration (e.g. '30s', '5m', '1h30m') or a whole number of seconds (e.g. '300'). Auto-calculated from duration if omitted.
queryYesPromQL query string (max 2000 chars).
durationNoLookback duration from now: a duration with units largest first (e.g. '15m', '1h', '3h20m', '7d') or a whole number of seconds (e.g. '3600'). 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. Changed2 schema fields changed
    • changedInput schema / properties / duration / description
      Previous value: -"Lookback duration from now (e.g. '15m', '1h', '6h', '24h', '7d'). Defaults to '1h'."New value: +"Lookback duration from now: a duration with units largest first (e.g. '15m', '1h', '3h20m', '7d') or a whole number of seconds (e.g. '3600'). Defaults to '1h'."
    • changedInput schema / properties / step / description
      Previous value: -"Resolution step (e.g. '30s', '1m', '5m'). Auto-calculated from duration if omitted."New value: +"Resolution step: a duration (e.g. '30s', '5m', '1h30m') or a whole number of seconds (e.g. '300'). Auto-calculated from duration if omitted."
  2. First observed

TDQS

A3.9/5.0
Behavior4/5

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

Annotations only supply readOnlyHint, so the description carries the rest and does disclose two non-obvious behaviors: which metric sources will answer and that results are automatically truncated to fit context limits. It does not say what happens for an unknown series or whether errors vs. empty results are distinguishable.

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?

A single front-loaded paragraph: purpose first, then source routing, then truncation. Dense but every sentence contributes; the parenthetical series list is slightly long but functional.

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 read-only, 4-parameter, fully described schema with no output schema, the definition supplies the source-availability and truncation context an agent needs. Return shape (a time series matrix) and empty-result behavior remain unstated, a minor 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 coverage is 100%, so step/duration/cluster_id formats are already documented and the description adds nothing there. It does add value for the query parameter by naming concrete ankra_* series (ankra_node_cpu_usage_cores, ankra_namespace_pod_restarts, etc.), which helps an agent construct a valid query, but this is marginal over the schema baseline.

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?

Opens with a specific verb+resource ('Execute a PromQL range query over a time window') and enumerates the question shapes it answers (trends, usage over time, restarts, spike detection). It distinguishes range queries from the series-listing sibling query_prometheus, though it never states explicitly what an instant query would look like.

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 when-to-use conditions and, more usefully, a data-source decision rule: the platform metrics store answers first and requires no connected Prometheus, while cAdvisor/kube-state-metrics names only resolve against a Prometheus configured in Cluster Settings > Metrics. No explicit exclusion or named alternative for a point-in-time query, which keeps it from a 5.

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.