Skip to main content
Glama

Query Workload Metrics (PromQL)

query_metrics
Read-onlyIdempotent

Run a PromQL query against Control Plane metrics (Prometheus-compatible). Default is a range query over the last hour at 60s step — pass resolution: "instant" for a point-in-time query, since / from / to to adjust the window, and step to control resolution. Results are sliced to the first 50 series in prose; the full Prometheus response is included as JSON. If you already know the metric, just query it: gauges like cpu_used, mem_used, replica_count are used bare — as are the pre-rated egress and requests_per_second (never wrap these in rate()); genuine counters need rate(), e.g. sum by (workload) (rate(container_restarts[5m])); latency is a histogram: histogram_quantile(0.95, sum by (le) (request_duration_ms_bucket)). Only when you are unsure of the exact metric name or label values — or a query returns no series — call list_metrics first to see what is actually present in the org (incl. custom metrics) and a metric’s real labels. Use this to verify autoscaling signals before changing scaling settings — measure first, then change.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
toNoEnd of range — RFC3339 or epoch seconds. Default: now.
orgYesOrganization 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.
fromNoStart of range — RFC3339 or epoch seconds. Overrides `since` when set.
stepNoStep (range queries only). Examples: "15s", "60s", "5m". Default: "60s".
queryYesPromQL 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().
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
okYesWhether the call succeeded.
dataNoThe full machine-readable result — list rows, the resource object, query results. Read THIS, not just the summary.
summaryYesOne-line summary of the result.
nextStepsNoRecommended follow-up actions for this task, in order.

TDQS

A5/5.0
Behavior5/5

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

Beyond the annotations (readOnly, idempotent, non-destructive), it discloses key behaviors: default range query over last hour at 60s step, result slicing to first 50 series in prose, full Prometheus response as JSON, and the rule never to wrap pre-rated metrics in rate(). No contradiction with annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is long but information-dense; every sentence serves a purpose, from defaults to output format to metric-type rules to fallback guidance. It is front-loaded with the primary action and default behavior, followed by examples and alternatives.

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?

The description covers defaults, time-window handling, resolution modes, output truncation, metric-type guidance, and explicit fallback to list_metrics. With an output schema present, return-value documentation is unnecessary, leaving no significant gap.

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

Parameters5/5

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

Although the schema has 100% coverage, the description adds crucial parameter semantics: what 'instant' vs 'range' means, how since/from/to interact, and metric-type-specific query patterns (gauges bare, counters with rate(), histograms with histogram_quantile). This goes far beyond the schema's 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?

The description opens with a specific verb and resource: 'Run a PromQL query against Control Plane metrics (Prometheus-compatible).' It clearly distinguishes from siblings by naming list_metrics as the lookup tool and focusing on Prometheus metrics versus audit events or traces.

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?

It explicitly states when to use the tool directly ('If you already know the metric, just query it') and when to call list_metrics first ('Only when you are unsure... or a query returns no series'). It also gives a concrete use case: 'Use this to verify autoscaling signals before changing scaling settings.'

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.

TDQS

A4.1/5.0
Disambiguation5/5

Every tool targets a distinct resource/action pair (e.g., get_resource vs get_resource_schema, list_deployments vs list_workload_replicas) and descriptions clearly differentiate purposes. No two tools appear to do the same thing.

Naming Consistency5/5

All tools follow a verb_noun snake_case pattern (create_gvc, update_workload, list_resources, query_metrics) with consistent verbs. The few imperative verbs (browse, build, mount) still maintain the same verb-first structure.

Tool Count1/5

With 55 tools, this server far exceeds the typical well-scoped 3-15 tool range. While each tool appears purposeful, the sheer number creates selection overhead and falls into the extreme 50+ category on the rubric.

Completeness4/5

The surface covers nearly the full Control Plane lifecycle: CRUD for GVC, workload, identity, policy, volumeset, and domain, plus observability, templates, image builds, and Terraform. Minor gaps include referenced but missing configure_workload_* tools and no secret creation/deletion (by design).