Skip to main content
Glama

cloudwatch_insights

Run a CloudWatch Logs Insights query to aggregate and analyze log data from one or more log groups, using custom query strings for metrics like top IPs or status code distribution.

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
queryYesLogs Insights query string, e.g. 'stats count(*) as hits by httpRequest.clientIp | sort hits desc | limit 20'.
log_groupNoA single log group name (or use log_groups).
log_groupsNoList of log group names to query together.
hours_backNoHow many hours back the query window spans.
regionNoAWS region (optional).
limitNoMax rows Insights returns.
timeout_secondsNoMax seconds to wait for the query to finish.
Behavior2/5

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

No annotations are provided, so the description must disclose behavioral traits, but it only states that it runs a query without mentioning potential side effects, permissions, rate limits, cost, or how results are returned. This lack of transparency is a significant gap.

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 three sentences, each serving a clear purpose: stating the action, providing examples and contrasting with a sibling, and specifying required inputs. No redundant information.

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?

Given the tool has 7 parameters and no output schema, the description covers purpose and usage well but lacks behavioral details (e.g., output format, timeouts, async behavior). It is mostly complete but has minor gaps.

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?

The input schema has 100% coverage with descriptive parameter descriptions, so the description adds minimal new semantics beyond restating the requirement for query and log_group(s). The baseline of 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?

The description explicitly states the tool runs a CloudWatch Logs Insights query over one or more log groups, and contrasts it with the sibling tool cloudwatch_top_ips, making its purpose clear and distinct.

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 provides explicit guidance on when to use this tool ('use it when cloudwatch_top_ips doesn't compute what you need') and specifies required inputs ('Provide a query plus log_group or log_groups').

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/zb-ss/servonaut'

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