Skip to main content
Glama

Query monitor metrics

get_metrics
Read-onlyIdempotent

Answer trend questions like 'how has p90 duration changed this month' or 'how has queue_depth trended'. Returns time series for the requested built-in fields or one custom metric (each reported value on the same short windows job charts use for raw points, otherwise avg and count per bucket), per monitor per environment (or per region for checks), matching cronitor metric get. Use metric_names to list known custom metric names. Requires at least one of monitors, groups, tags, or types.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "get_metrics"
  }
}

Input Schema

NameRequiredDescriptionDefault
endNoRange end as unix seconds. Defaults to now.
envNoEnvironment key or name. Defaults to the organization's default environment. A human saying 'staging' usually means the environment named staging.
tagsNoTags; includes every monitor carrying any of them.
timeNoNamed time range ending now. Overrides start and end.
startNoRange start as unix seconds. Defaults to one hour before end.
typesNoMonitor types to include.
fieldsNoBuilt-in metric fields to return for each period.
groupsNoGroup keys; includes every monitor in each group.
metricNoCustom metric name to query. Short windows return each reported value; longer windows return avg and count per bucket. Leading/trailing whitespace is trimmed and names are lowercased. Cannot be combined with fields or metric_names.
regionsNoCheck regions to include. Defaults to every region.
monitorsNoMonitor keys to include.
with_nullsNoEmit explicit null periods where no data was recorded.
metric_namesNoList known custom metric names for the selected monitors and range.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4/5.0
Behavior4/5

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

Annotations already declare readOnlyHint, idempotentHint, destructiveHint=false and closed-world behavior, so safety is covered. The description adds real value beyond that: the result is bucketed per monitor per environment (or per region for checks), short windows return each reported value while longer windows return avg and count per bucket, and custom metric names are trimmed and lowercased. It says nothing about result size limits or pagination.

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 the user-facing question it answers, then the return format, then the selection requirement. Three dense sentences, each doing work, though the middle sentence packs several ideas (bucketing, per-entity scoping, CLI parity) that could be split for faster scanning.

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?

For a 13-parameter tool with zero required parameters and no output schema, the description supplies the missing pieces: what a callable request looks like and what shape the response takes. Remaining gaps (defaults interaction between time/start/end, pagination of large series) are minor and partly covered by the schema prose.

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 contributes a cross-parameter constraint the schema cannot express: at least one of monitors, groups, tags, or types must be supplied. It also clarifies the mutual exclusion around custom metrics and the short-vs-long window aggregation for `metric`, adding meaning beyond the field descriptions.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource ('Returns time series for the requested built-in fields or one custom metric'), and anchors the intent with concrete example questions like 'how has p90 duration changed this month'. It also maps the call to its CLI equivalent ('matching `cronitor metric get`'). It stops short of naming a sibling such as get_aggregates, so the boundary with the aggregate tool must be inferred.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

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

Gives clear trigger context via the trend-question examples and a prerequisite ('Requires at least one of monitors, groups, tags, or types'), plus a routing hint to use metric_names to discover custom metric names. It does not state when NOT to use this tool or name an alternative, which keeps it below a 5.

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