Skip to main content
Glama

get_resource_metrics

Read-onlyIdempotent

Fetch time-series metric statistics for a resource, returning raw data points or summary statistics. Identify missing metrics with suggested similar keys.

Instructions

[READ] Fetch time-series metric statistics for a resource.

Returns mode ("raw" or "summary"), then metrics (raw: metric key -> list of {timestamp_ms, value} points, only keys with points) or summary (summary=True: per key n, min, max, avg, latest, first/latest timestamps, change_count and change_points — {timestamp_ms, from, to} where the value changed, at most 50, most recent kept), and missing (one entry per requested key with no points: not_collected_for_resource with similar_keys to try, no_data_in_window, resource_reports_no_stat_keys, or undetermined). Never report a missing key as zero. Prefer summary=True for windows over a few hours. For a single current score use get_resource_health instead.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
hoursNoNumber of hours of history to retrieve. Default 1.
targetNoAria target name from config; default when omitted.
summaryNoReturn per-metric summaries instead of every point. Default False.
metric_keysYesMetric keys to fetch, e.g. ["cpu|usage_average", "mem|usage_average", "disk|usage_average", "net|usage_average"].
resource_idYesThe resource UUID.
rollup_typeNoAggregation type: AVG, MAX, MIN, SUM, COUNT, LATEST. Default AVG.AVG

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv1.15.0
    • addedInput schema / properties / summary
      Added value: +{
      +  "default": false,
      +  "description": "Return per-metric summaries instead of every point. Default False.",
      +  "title": "Summary",
      +  "type": "boolean"
      +}
  2. Changed6 schema fields changedv1.10.0
    • addedInput schema / additionalProperties
      Added value: +false
    • addedInput schema / properties / hours / description
      Added value: +"Number of hours of history to retrieve. Default 1."
    • addedInput schema / properties / metric_keys / description
      Added value: +"Metric keys to fetch, e.g. [\"cpu|usage_average\", \"mem|usage_average\", \"disk|usage_average\", \"net|usage_average\"]."
    • addedInput schema / properties / resource_id / description
      Added value: +"The resource UUID."
    • addedInput schema / properties / rollup_type / description
      Added value: +"Aggregation type: AVG, MAX, MIN, SUM, COUNT, LATEST. Default AVG."
    • addedInput schema / properties / target / description
      Added value: +"Aria target name from config; default when omitted."
  3. Addedv1.5.29
  4. Removedv1.5.28
  5. First observedv1.3.2

TDQS

A4.8/5.0
Behavior5/5

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

Beyond the readOnlyHint/idempotentHint annotations, the description discloses key behaviors: raw vs summary output shape, missing-key reasons, a cap on change points, and an explicit warning never to report a missing key as zero. This adds substantial context over structured annotations.

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?

The description is dense and front-loaded, but it is one long paragraph with nested details. It has no fluff, but it could benefit from bullets or a slightly tighter structure; still the length is justified by the tool's complexity.

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?

Given no output schema exists, the description fully explains return values: raw points, summary statistics, missing modes, and cap limits. Combined with the schema and annotations, the agent has enough to call it correctly, including edge cases like missing keys.

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% and the schema already documents each parameter, so baseline 3 applies. The description adds meaningful semantic detail for summary and metric_keys by explaining the raw/summary response structure and missing-key outcomes, though it does not add extra meaning for hours, target, or rollup_type.

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 explicitly says it fetches time-series metric statistics for a resource and contrasts raw versus summary modes, which distinguishes it from sibling tools like get_resource_health. It also mentions return and missing content, so an agent can tell what this tool is for without opening the 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?

It gives actionable guidance: prefer summary=True for windows over a few hours, and directly names get_resource_health as the alternative for a single current score. This is an explicit when/alternative pairing that helps the agent know which sibling to choose.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.