Skip to main content
Glama

get_resource_metrics

Read-onlyIdempotent

Retrieve historical time-series metrics for a resource by metric key. Supply resource ID, keys, hours, and rollup type to get timestamped points for trend analysis and troubleshooting.

Instructions

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

Returns a dict keyed by metric key, each mapping to a list of {timestamp_ms, value} points — not an envelope. Use this for history; for a single current score use get_resource_health instead. A key the API has no data for does not appear in the result at all, so check which keys came back before reporting a metric as zero.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
hoursNoNumber of hours of history to retrieve. Default 1.
targetNoAria target name from config; default when omitted.
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. 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."
  2. Addedv1.5.29
  3. Removedv1.5.28
  4. First observedv1.3.2

TDQS

A4.5/5.0
Behavior4/5

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

Annotations already cover read-only/idempotent safety, so the description adds useful behavior beyond them: the exact return shape (dict keyed by metric key) and the important missing-key behavior. This is meaningful context that affects how an agent interprets results.

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?

Three dense sentences with no filler. The purpose is front-loaded, followed by return shape, usage guidance, and a critical data-interpretation caveat. Every sentence earns its place.

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, the description must explain return values, and it does: dict keyed by metric key, list of {timestamp_ms, value} points, and absence behavior. Combined with full schema coverage and rich annotations, nothing essential is missing for correct invocation.

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

Parameters3/5

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

Schema description coverage is 100%, so the schema already documents all parameters including examples and defaults. The description adds no significant parameter-level meaning beyond what the schema provides, so baseline 3 is appropriate.

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 ('Fetch time-series metric statistics for a resource') and explicitly distinguishes itself from get_resource_health. The 'not an envelope' return shape note further clarifies what the tool does.

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 when-to-use guidance: 'Use this for history; for a single current score use get_resource_health instead.' It also adds operational guidance about checking which keys came back before reporting a metric as zero.

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