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)). Without query, lists the metrics instead: the documented defaults with a PromQL template each, plus every metric present in the org now (custom, mk8s). mk8s clusters with the metrics add-on label their series cluster_name and node, e.g. sum by (node) (rate(node_cpu_seconds_total{cluster_name="prod",mode!="idle"}[5m])). List first when a name or label is uncertain or a query returns no series. Measure before changing autoscaling.

Input 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".
limitNoWithout `query`: most documented metrics to list (default: all).
queryNoPromQL, scoped to the org (no org label). Real metric names only; omit `query` to list them 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".
filterNoWithout `query`: a case-insensitive substring that narrows the listed names, e.g. "cpu".
metricNoWithout `query`: a metric name, custom ones too; returns its live labels and their values.
resolutionNo`instant` for /query — a single sample at `to` (defaults to now); `from`/`since`/`step` are ignored. `range` for /query_range (default).

Output Schema

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

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / properties / metric / description
      Previous value: -"Without `query`: a metric name, custom ones too; returns its live label values (workload, gvc, location)."New value: +"Without `query`: a metric name, custom ones too; returns its live labels and their values."
  2. Changed5 schema fields changed
    • addedInput schema / properties / filter
      Added value: +{
      +  "description": "Without `query`: a case-insensitive substring that narrows the listed names, e.g. \"cpu\".",
      +  "type": "string"
      +}
    • addedInput schema / properties / limit
      Added value: +{
      +  "description": "Without `query`: most documented metrics to list (default: all).",
      +  "maximum": 500,
      +  "minimum": 1,
      +  "type": "integer"
      +}
    • addedInput schema / properties / metric
      Added value: +{
      +  "description": "Without `query`: a metric name, custom ones too; returns its live label values (workload, gvc, location).",
      +  "type": "string"
      +}
    • changedInput schema / properties / query / description
      Previous 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()."New value: +"PromQL, scoped to the org (no org label). Real metric names only; omit `query` to list them if unsure. Pre-rated egress, cross_zone_traffic, and requests_per_second are queried bare, never in rate()."
    • removedInput schema / required
      Removed value: -[
      -  "query"
      -]
  3. 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."
  4. First observed

TDQS

Score is being calculated.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.