Skip to main content
Glama

Query Prometheus

query_prometheus
Read-only

Execute a PromQL instant query for the cluster. Returns current values as a vector. The platform metrics store answers first and needs no connected Prometheus: it holds the Ankra agent's ankra_* series (labels node; namespace; namespace, workload, kind), e.g. sum by (node) (ankra_node_cpu_usage_cores), sum by (node) (ankra_node_memory_working_set_bytes), ankra_node_cpu_capacity_cores, ankra_node_ready, sum by (namespace) (ankra_namespace_pod_restarts), ankra_namespace_pod_restarts_total, ankra_workload_pod_restarts, ankra_namespace_cpu_usage_cores, ankra_namespace_memory_working_set_bytes. cAdvisor and kube-state-metrics names (container_*, kube_*) answer only from a Prometheus connected in Cluster Settings > Metrics. For a trend or anything over a window use query_prometheus_range.

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"
  }
}

Input Schema

NameRequiredDescriptionDefault
queryYesPromQL query string (max 2000 chars).
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.6/5.0
Behavior4/5

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

Annotations only declare readOnlyHint=true; the description adds real behavioral context on top — instant vs. range semantics, vector result shape, and the two-tier data-source resolution with its dependency on Cluster Settings > Metrics. It does not cover auth/permissions or query cost/limits, which is the remaining gap.

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?

Front-loaded with purpose, result shape, and the sibling alternative before the detail. The long semicolon-separated enumeration of ankra_* series is dense and would scan better as a list, but each metric name genuinely prevents a failed query rather than padding.

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 only two parameters, full schema coverage, and no output schema, the description carries the burden of explaining return semantics — and it does ("Returns current values as a vector"). Data-source availability and the range-query alternative are both covered, leaving nothing an agent needs in order 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 baseline is 3, but the description goes beyond it by supplying concrete valid PromQL examples (sum by (node) (ankra_node_cpu_usage_cores), ankra_node_ready, etc.) that teach what the `query` parameter can actually contain against this backend. It adds no guidance on the cluster_id parameter beyond what the schema already says.

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 instant query for the cluster") plus the return shape ("Returns current values as a vector"). It explicitly distinguishes itself from the sibling query_prometheus_range, so an agent can pick correctly 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 Guidelines5/5

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

Gives explicit routing guidance: instant queries here, "For a trend or anything over a window use query_prometheus_range." It also states the precondition that the platform metrics store answers first and needs no connected Prometheus, and that container_*/kube_* names only resolve with a Prometheus configured in Cluster Settings > Metrics, which prevents misdiagnosing empty results.

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.