Skip to main content
Glama

get_resource_metrics

Read-onlyIdempotent

Fetches time-series metric statistics for a resource, returning raw points or per-metric summaries and explicitly flagging missing keys instead of reporting zero.

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, p95, 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. Over days or weeks, set interval_type="DAYS" (or "HOURS"): the default is one point per 5 minutes, about 8,600 per key for a month. Each point is rollup_type over its span, so with AVG the summary max is the highest daily average, not the peak: use rollup_type="MAX" for peaks. p95 is likewise over the returned points (with DAYS it is the p95 of daily values) and null, with p95_unavailable, below 20 points. interval in the result gives the resolution requested and, in applied, the one Aria reports it used. For a single current score use get_resource_health instead.

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": {
      "resource_id": "<resource_id>",
      "metric_keys": "<metric_keys>"
    },
    "name": "get_resource_metrics"
  }
}

Input 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
interval_typeNoSpan each point covers: MINUTES, HOURS, DAYS, WEEKS or MONTHS. Default MINUTES. Each point is rollup_type over the span, so DAYS with AVG gives daily averages.MINUTES
interval_quantityNoNumber of interval_type units per point, at least 1. Default 5 (with MINUTES: Aria's 5-minute collection).

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv2.2.0
    • addedInput schema / properties / interval_quantity
      Added value: +{
      +  "default": 5,
      +  "description": "Number of interval_type units per point, at least 1. Default 5 (with MINUTES: Aria's 5-minute collection).",
      +  "title": "Interval Quantity",
      +  "type": "integer"
      +}
    • addedInput schema / properties / interval_type
      Added value: +{
      +  "default": "MINUTES",
      +  "description": "Span each point covers: MINUTES, HOURS, DAYS, WEEKS or MONTHS. Default MINUTES. Each point is rollup_type over the span, so DAYS with AVG gives daily averages.",
      +  "title": "Interval Type",
      +  "type": "string"
      +}
  2. 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"
      +}
  3. 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."
  4. Addedv1.5.29
  5. Removedv1.5.28
  6. First observedv1.3.2

TDQS

A4.9/5.0
Behavior5/5

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

Beyond the read-only annotations, it describes the return structure, missing-key behavior, safeguards against reporting missing keys as zero, p95 availability rules, and how summary values depend on the chosen rollup and interval. This is rich behavioral context that an agent would otherwise have to infer.

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 purpose is front-loaded and the content is dense but largely earns its space because of the tool's complexity. It is longer than ideal as a single flowing paragraph, but it does not contain obvious filler.

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 no output schema and eight parameters, the description carries the right burden: it explains return shapes, missing-data cases, default resolution, rollup effects, and alternatives. An agent has enough information to call the tool correctly without guessing about summary semantics.

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 schema coverage is 100%, the description adds important meaning about interactions: summary mode changes the return shape, interval_type controls point span, rollup_type changes what summary statistics mean, and interval reflects the requested and applied resolution. It also explains the missing metadata returned for keys with no data.

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 first sentence gives a specific verb and resource: fetch time-series metric statistics for a resource. The ending explicitly routes the agent to get_resource_health for a single current score, so it is distinguishable from a key sibling.

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 states exactly when to prefer summary=True and when to switch to DAYS or HOURS for longer windows. It also explains when to use rollup_type=MAX for peaks and when to use get_resource_health instead.

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