Skip to main content
Glama
YawLabs

@yawlabs/aws-mcp

Official
by YawLabs

aws_metrics_query

Read-onlyIdempotent

Query AWS CloudWatch metrics across multiple services with a single request, using metric math expressions and auto-picked periods to stay within response limits.

Instructions

Query CloudWatch metrics via GetMetricData (the modern multi-metric / expression-capable API, not the legacy get-metric-statistics). Pass queries as a flat array of {id, namespace, metricName, dimensions?, statistic?, period?, expression?, label?}; the tool shapes them into MetricDataQueries for you. startTime/endTime accept ISO 8601 or relative shorthand ('15m', '1h', '1d', '1w'); endTime defaults to 'now'. Period is auto-picked from the time range when omitted (60s for <=3h, 300s for <=24h, 900s for <=15d, 3600s otherwise) to stay under CloudWatch's ~100,800-datapoint response cap. Returns {series: [{id, label?, timestamps, values, statusCode?}], messages?, periodSeconds, profile, region, nextToken, hasMore}. When CloudWatch truncates a large response, hasMore is true and nextToken carries the resume cursor -- call again with nextToken set to fetch the next page (rare for typical agent queries that stay within the per-request cap). Use for 'show me the CPU on this instance for the last hour', 'sum lambda invocations across these 3 functions', or expression-based 'p99 latency divided by average latency' lookups.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queriesYes1-100 queries. Each is either a metric-stat (namespace + metricName) or an expression.
startTimeNoISO 8601 timestamp or relative shorthand ('15m', '1h', '1d', '1w'). Default '1h' (one hour ago).
endTimeNoISO 8601 timestamp or relative shorthand. Default 'now'.
scanByNoSort order for returned datapoints. Default 'TimestampDescending' (matches CloudWatch's default).
maxDataPointsNoSoft cap on returned datapoints across all queries. CloudWatch's hard cap is ~100,800; lower this to keep response sizes manageable. Forwarded as CloudWatch's MaxDatapoints (single 'p') field; the camelCase schema name follows this server's convention.
nextTokenNoResume cursor from a previous call's `nextToken`. Omit for the first page. Forwarded as CloudWatch's NextToken; only meaningful when a prior call returned `hasMore: true`.
profileNoOverride session profile for this call.
regionNoOverride session region for this call.
timeoutMsNoTimeout in milliseconds. Default 60000 (60s).
Behavior5/5

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

Annotations already indicate read-only, destructive hint false, idempotent. The description adds valuable behavioral details: period auto-pick algorithm based on time range, pagination with hasMore and nextToken, and CloudWatch truncation behavior. No contradictions with annotations.

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?

The description is front-loaded with purpose, followed by parameter details and usage examples. Each sentence contributes meaningful information. Despite length, it is well-structured and avoids redundancy.

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?

Despite no output schema, the description explains the return format (series, messages, etc.) and pagination. Given the tool's complexity (9 parameters, auto-pick behavior, expression support), the description covers all necessary aspects for an AI agent to use it correctly.

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?

Schema coverage is 100%, but description adds significant context: explains the period auto-pick logic in detail, clarifies maxDataPoints as a soft cap, describes nextToken usage, and explains expression vs metric-stat queries. This goes far beyond what the schema provides.

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 clearly states the tool queries CloudWatch metrics via GetMetricData, distinguishing it from the legacy API. It provides specific use cases like 'show me the CPU on this instance for the last hour' and 'sum lambda invocations across these 3 functions', making the purpose very clear.

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?

The description includes concrete examples of when to use the tool and mentions pagination handling. However, it does not explicitly state when not to use it or directly compare to sibling tools, though the context implies its specialized role for multi-metric/expression queries.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/YawLabs/aws-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server