Skip to main content
Glama

cloudwatch_insights

Query CloudWatch Logs Insights across one or more log groups to aggregate, rank, or time-bucket events by IP, status, URI, or custom stats. Supply a query plus log_group or log_groups.

Instructions

Run a CloudWatch Logs Insights query over one or more log groups. The general aggregation primitive (top IPs, status mix, URI ranking, time-bucketing) — use it when cloudwatch_top_ips doesn't compute what you need. Provide a query plus log_group or log_groups.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoMax rows Insights returns.
queryYesLogs Insights query string, e.g. 'stats count(*) as hits by httpRequest.clientIp | sort hits desc | limit 20'.
regionNoAWS region (optional).
accountNoAWS account label to act in; omit for the default account.
log_groupNoA single log group name (or use log_groups).
hours_backNoHow many hours back the query window spans.
log_groupsNoList of log group names to query together.
timeout_secondsNoMax seconds to wait for the query to finish.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv2.28.0
    • addedInput schema / properties / account
      Added value: +{
      +  "description": "AWS account label to act in; omit for the default account.",
      +  "type": "string"
      +}
  2. Addedv2.24.0
  3. Removedv2.23.8
  4. First observedv1.0.0

TDQS

A3.7/5.0
Behavior2/5

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

No annotations are provided, so the description carries the full behavioral burden. It implies a read-only query but never states that it is non-destructive, does not mention that Insights queries bill per GB scanned and can be slow, and says nothing about result-return behavior or failure modes. For a cost-bearing AWS query tool the behavioral disclosure is thin.

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?

Two tight sentences with no filler. The core action and its scope come first, then the differentiation from the sibling and the required inputs. Every clause earns its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With no annotations and no output schema across 8 parameters, the description is adequate but not complete: it does not explain that the returned columns depend entirely on the query, says nothing about the query window defaults/timeouts, and omits cost implications. Minimum viable for a query tool, but an agent would benefit from more.

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 every parameter is already documented in the schema. The description's 'provide a query plus log_group or log_groups' restates the mutual exclusivity already implied by the schema fields, adding no syntax, valid-value, or trade-off detail beyond it. Baseline 3 applies.

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+resource: run a CloudWatch Logs Insights query over one or more log groups. It goes further by naming the sibling cloudwatch_top_ips and clarifying that this is the general-purpose aggregation primitive, so an agent can distinguish the two without opening either schema.

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?

Explicitly routes the agent with 'use it when cloudwatch_top_ips doesn't compute what you need,' and enumerates the kind of aggregations it fits (top IPs, status mix, URI ranking, time-bucketing). No explicit when-not beyond that single named alternative, and no mention of cost/size limits that would steer an agent away for very expensive scans.

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