Skip to main content
Glama

Run a Metrics Aggregation

query_metrics
Read-onlyIdempotent

Run a canned aggregation over Cycle's metrics store. Presets:

  • container_instance_count (scope: container): Hourly instance count for a container; reveals flapping, autoscaling, and unexpected shrinkage.

  • discovery_resolutions (scope: environment): Hourly internal DNS resolution counts for an environment's discovery service (lookups, cache hits, not-founds). Non-zero not-founds are the smoking gun for containers unable to find each other.

  • lb_controller_traffic (scope: environment): Hourly load balancer controller metrics for an environment (requests, connections, disconnect reasons, per-destination counters). Historical complement to get_telemetry target=load_balancer.

  • neighbor_latency (scope: server): Latest server-to-server mesh latency per neighbor; negative latency_ms means the neighbor is unreachable (outage).

  • server_cpu (scope: server): Hourly CPU usage trend for a server, per CPU state metric.

  • server_ram (scope: server): Hourly RAM trend for a server (available/free/total KB metrics).

Pass the input matching the preset's scope (server, environment, or container). Metrics data can lag by up to ~10 minutes; each row carries the sample time. No free-form queries — if none of the presets fit, say so rather than improvising. Read-only.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
presetYesWhich canned aggregation to run. See the tool description for what each returns.
serverNoServer hostname, nickname, or ID. Required for server-scoped presets.
contextNoWhy are you calling this tool? Briefly describe the user's goal.
containerNoContainer. Required for container-scoped presets.
environmentNoEnvironment. Required for environment-scoped presets.
lookback_hoursNoHow many hours back to aggregate, 1-72.
conversation_idNoConversation tracking id. Omit on your first tool call; every result then includes a conversation_id line — pass that exact value on all later calls in this conversation.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.5/5.0
Behavior4/5

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

Annotations already cover the safety profile (readOnly, idempotent, non-destructive), so the bar is lower, and the description still adds real operational context: metrics can lag up to ~10 minutes, each row carries the sample time, and the tool is read-only. It stops short of describing result shape or row limits, but for a read-only aggregation this is solid added value.

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 and the no-free-form rule are front-loaded, and the bulleted preset list is scannable. The parenthetical explanations inside each bullet are slightly verbose but each one describes a diagnostic signal an agent would otherwise have to guess at, so the length is mostly earned.

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?

With no output schema, the description carries the burden of explaining what comes back, and it does so per preset (counts, latency per neighbor, CPU/RAM trends) plus freshness caveats. Remaining gaps are minor: no statement of row counts, pagination, or the exact fields in each result.

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 the preset-to-scope mapping inline ('scope: container', 'scope: environment', 'scope: server'), letting the agent resolve which of server/container/environment to supply without cross-referencing per-field text. It adds little on lookback_hours or conversation_id beyond the schema, keeping it at a 4 rather than 5.

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?

Opens with a specific verb+resource ('Run a canned aggregation over Cycle's metrics store') and then enumerates all six presets with the scope and the signal each one surfaces. It explicitly differentiates itself from the sibling get_telemetry ('Historical complement to get_telemetry target=load_balancer'), so an agent can choose between them 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?

States the selection rule directly: pick a preset, then pass the input matching that preset's scope (server/environment/container). It also gives an explicit exclusion — 'No free-form queries — if none of the presets fit, say so rather than improvising' — which is exactly the kind of when-not guidance that prevents misuse.

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.

Resources