Skip to main content
Glama

cloudwatch_top_ips

Rank top client IPs in CloudWatch WAF/ALB log groups by total, allowed, and blocked counts to identify abusive IPs before banning them.

Instructions

Rank the top client IPs in a CloudWatch log group. Parses WAF/ALB structured logs to report per-IP total, allowed, and blocked counts — use it to find abusive IPs before banning.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoMaximum IPs to return.
regionNoAWS region (optional).
accountNoAWS account label to act in; omit for the default account.
log_groupYesCloudWatch log group name (e.g. a WAF or ALB access-log group).
hours_backNoHow many hours back to scan.
max_eventsNoMaximum events to scan (0 = unlimited, capped at 50000).
action_filterNoCount only events with this WAF action: 'ALLOW', 'BLOCK', or empty for all.

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
Behavior3/5

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

With no annotations, the description carries the full behavioral burden. It discloses that it parses WAF/ALB structured logs and what it counts, and it is implicitly read-only, but it does not state AWS permission/auth requirements, scan cost, or rate behavior — and the 50000-event cap is only surfaced in the schema, not the description.

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, verb-first and front-loaded, with the analytical output and the operational use case packed in without any filler.

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?

No output schema exists, and the description only partly covers the return shape (per-IP total/allowed/blocked). For a 7-parameter AWS tool with no annotations, missing auth/permission and output-format detail leaves it adequate but not fully self-sufficient.

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 all seven parameters (limit, region, account, log_group, hours_back, max_events, action_filter) are already documented in the schema. The description adds no parameter-level detail (e.g. expected log format, region defaults), so the baseline 3 applies.

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 ('Rank') and resource ('top client IPs in a CloudWatch log group'), and adds what it parses (WAF/ALB structured logs) and the output metrics (total, allowed, blocked per IP). It does not name a sibling, but the domain is specific enough that an agent can distinguish it from cloudwatch_get_log_events or cloudwatch_insights.

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 a clear use context: 'use it to find abusive IPs before banning,' which points toward the ban/block workflow. However, it never states when NOT to use it or names alternatives (e.g. cloudwatch_insights for ad-hoc queries), so it stops short of explicit routing.

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