Skip to main content
Glama

cloudwatch_get_log_events

Fetch recent CloudWatch log events from a log group, with optional filter pattern and server-side ranking by client IP, status, or URI to reduce data volume.

Instructions

Fetch recent events from a CloudWatch log group within the last N hours, with an optional filter pattern. Set group_by (clientIp|status|uri) to get a server-side ranked summary (top_n, default 20) instead of raw lines — avoids dumping huge log pulls. summary_only returns just the event count.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
top_nNoWhen group_by is set, how many top entries to return (0 = default 20).
regionNoAWS region (optional).
group_byNoAggregate the events by this structured field and return a ranked summary.
client_ipNoConvenience: build the structured WAF/ALB selector { $.httpRequest.clientIp = "x" } for this IP. Overrides filter_pattern.
log_groupYesCloudWatch log group name.
hours_backNoHow many hours back to search.
max_eventsNoMaximum events to return (0 = unlimited, capped at 50000).
summary_onlyNoReturn only the event count, not raw lines.
filter_patternNoCloudWatch Logs filter pattern (optional). A bare literal (an IP, a path) is auto-quoted so it matches reliably; JSON/space-delimited patterns are passed through untouched.
Behavior4/5

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

With no annotations, the description carries full burden. It discloses the dual behavior (raw events vs ranked summary), the performance hint of avoiding huge pulls, and the summary_only option. However, it does not mention read-only nature, cost, or rate limits. The time window (hours_back) is implied in 'last N hours'.

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?

Two sentences, front-loaded with purpose. The second sentence is dense but packs the key modal distinction. Could be split for readability, but overall efficient without waste.

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?

Given 9 parameters, no output schema, and no annotations, the description covers the main use cases but lacks detail on the return format (e.g., structure of raw events) and does not mention the max_events cap or the filter_pattern auto-quoting behavior. Adequate but not fully comprehensive.

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?

With 100% schema coverage, baseline is 3. The description adds value by explaining that group_by produces a server-side ranked summary with default top_n=20, and that summary_only returns just the count. It also hints at the performance benefit. This goes beyond the schema's descriptions.

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 fetches recent events from a CloudWatch log group, with optional filtering and an aggregation mode via group_by. It distinguishes itself from siblings like cloudwatch_top_ips (specific field) and cloudwatch_insights (analytics) by highlighting the raw vs ranked summary duality.

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

Usage Guidelines3/5

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

The description implies usage for fetching recent log events and offers a summary mode to avoid large pulls, but it does not explicitly state when to use this tool over alternatives like cloudwatch_insights or cloudwatch_top_ips. No when-not or explicit comparison to sibling tools.

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