Skip to main content
Glama

Query Workload Metrics (PromQL)

query_metrics
Read-onlyIdempotent

Run a PromQL query over Control Plane metrics. Default: a range query over the last hour at a 60s step; resolution "instant" for one point, and since, from, to, and step to adjust. Prose shows the first 50 series; the full response is attached as JSON. Gauges (cpu_used, mem_used, replica_count) and the pre-rated egress and requests_per_second are queried bare; counters need rate(), e.g. sum by (workload) (rate(container_restarts[5m])); latency is histogram_quantile(0.95, sum by (le) (request_duration_ms_bucket)). Unsure of a metric name or label, or no series returned: list_metrics first. Measure before changing autoscaling.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
toNoEnd of range — RFC3339 or epoch seconds. Default: now.
orgNoOrganization slug.
fromNoStart of range — RFC3339 or epoch seconds. Overrides `since` when set.
stepNoStep (range queries only). Examples: "15s", "60s", "5m". Default: "60s".
queryYesPromQL, scoped to the org (no org label). Real metric names only; list_metrics if unsure. Pre-rated egress, cross_zone_traffic, and requests_per_second are queried bare, never in rate().
sinceNoRelative lookback (e.g., "5m", "1h", "24h"). Used when `from` is not provided. Default: "1h".
resolutionNo`instant` for /query — a single sample at `to` (defaults to now); `from`/`since`/`step` are ignored. `range` for /query_range (default).

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
okYes
dataNoThe full result. Read this, not only the summary.
detailsNo
summaryYes
nextStepsNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed21 schema fields changed
    • removedInput schema / $schema
      Removed value: -"http://json-schema.org/draft-07/schema#"
    • removedInput schema / additionalProperties
      Removed value: -false
    • removedInput schema / properties / from / maxLength
      Removed value: -40
    • changedInput schema / properties / org / description
      Previous value: -"Organization slug (lowercase kebab-case). NEVER guess — if the user has not named one, ask. On org-not-found, stop and ask; do not retry variants."New value: +"Organization slug."
    • removedInput schema / properties / org / maxLength
      Removed value: -63
    • removedInput schema / properties / org / minLength
      Removed value: -1
    • removedInput schema / properties / org / pattern
      Removed value: -"^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$"
    • changedInput schema / properties / query / description
      Previous value: -"PromQL query, scoped automatically to the org in the request path (no `org=` label needed). Use REAL Control Plane metric names — call list_metrics if unsure. Examples with actual metrics: `avg by (workload) (cpu_used)` (gauge), `sum by (workload) (rate(container_restarts[5m]))` (counter), `histogram_quantile(0.95, sum by (le) (request_duration_ms_bucket))` (latency histogram). Pre-rated series — `egress`, `cross_zone_traffic`, `requests_per_second` — are queried bare, never wrapped in rate()."New value: +"PromQL, scoped to the org (no org label). Real metric names only; list_metrics if unsure. Pre-rated egress, cross_zone_traffic, and requests_per_second are queried bare, never in rate()."
    • removedInput schema / properties / query / maxLength
      Removed value: -4000
    • removedInput schema / properties / query / minLength
      Removed value: -1
    • removedInput schema / properties / since / maxLength
      Removed value: -40
    • removedInput schema / properties / step / maxLength
      Removed value: -20
    • removedInput schema / properties / to / maxLength
      Removed value: -40
    • changedInput schema / required
      Previous value: -[
      -  "org",
      -  "query"
      -]New value: +[
      +  "query"
      +]
    • removedOutput schema / $schema
      Removed value: -"http://json-schema.org/draft-07/schema#"
    • removedOutput schema / additionalProperties
      Removed value: -false
    • changedOutput schema / properties / data / description
      Previous value: -"The full machine-readable result — list rows, the resource object, query results. Read THIS, not just the summary."New value: +"The full result. Read this, not only the summary."
    • addedOutput schema / properties / details
      Added value: +{
      +  "type": "string"
      +}
    • removedOutput schema / properties / nextSteps / description
      Removed value: -"Recommended follow-up actions for this task, in order."
    • removedOutput schema / properties / ok / description
      Removed value: -"Whether the call succeeded."
    • removedOutput schema / properties / summary / description
      Removed value: -"One-line summary of the result."
  2. First observed

TDQS

A4.6/5.0
Behavior4/5

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

Annotations already cover read-only/idempotent safety, but the description adds genuinely useful behavior beyond them: default range query over the last hour at 60s step, instant vs range resolution, and result presentation (first 50 series in prose, full JSON attached). It does not discuss rate limits or error conditions, but the added operational context is substantial.

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?

Purpose, defaults, and metric-type guidance are front-loaded, and each sentence carries information. It is dense and runs long for a single paragraph, but almost no filler is present.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With an output schema present, return values need not be explained, yet the description still clarifies response shape and truncation. Combined with defaults, resolution modes, and metric-type guidance, an agent has everything needed to call it correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the baseline is 3, but the description adds meaning beyond the schema by explaining query semantics: gauges are queried bare, counters need rate(), latency uses histogram_quantile, and queries are org-scoped without an org label. These PromQL usage rules go well beyond the field descriptions.

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: 'Run a PromQL query over Control Plane metrics,' and the title reinforces the scope. It is clearly distinguished from sibling list_metrics, which it explicitly routes to for name/label discovery.

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

Usage Guidelines5/5

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

Gives explicit routing: 'Unsure of a metric name or label, or no series returned: list_metrics first,' and states the intended workflow 'Measure before changing autoscaling.' It names both the alternative tool and the condition that selects it.

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.