CloudWatch

Query and monitor AWS CloudWatch logs, metrics, and alarms

Usage Instructions

Integrate AWS CloudWatch into workflows. Run Log Insights queries, list log groups, retrieve log events, list and get metrics, and monitor alarms. Requires AWS access key and secret access key.

Tools

cloudwatch_query_logs

Run a CloudWatch Log Insights query against one or more log groups

Input

ParameterTypeRequiredDescription
awsRegionstringYesAWS region (e.g., us-east-1)
awsAccessKeyIdstringYesAWS access key ID
awsSecretAccessKeystringYesAWS secret access key
logGroupNamesarrayYesLog group names to query
queryStringstringYesCloudWatch Log Insights query string
startTimenumberYesStart time as Unix epoch seconds
endTimenumberYesEnd time as Unix epoch seconds
limitnumberNoMaximum number of results to return

Output

ParameterTypeDescription
resultsarrayQuery result rows
statisticsobjectQuery statistics (bytesScanned, recordsMatched, recordsScanned)
statusstringQuery completion status

cloudwatch_describe_log_groups

List available CloudWatch log groups

Input

ParameterTypeRequiredDescription
awsRegionstringYesAWS region (e.g., us-east-1)
awsAccessKeyIdstringYesAWS access key ID
awsSecretAccessKeystringYesAWS secret access key
prefixstringNoFilter log groups by name prefix
limitnumberNoMaximum number of log groups to return

Output

ParameterTypeDescription
logGroupsarrayList of CloudWatch log groups with metadata

cloudwatch_get_log_events

Retrieve log events from a specific CloudWatch log stream

Input

ParameterTypeRequiredDescription
awsRegionstringYesAWS region (e.g., us-east-1)
awsAccessKeyIdstringYesAWS access key ID
awsSecretAccessKeystringYesAWS secret access key
logGroupNamestringYesCloudWatch log group name
logStreamNamestringYesCloudWatch log stream name
startTimenumberNoStart time as Unix epoch seconds
endTimenumberNoEnd time as Unix epoch seconds
limitnumberNoMaximum number of events to return

Output

ParameterTypeDescription
eventsarrayLog events with timestamp, message, and ingestion time

cloudwatch_describe_log_streams

List log streams within a CloudWatch log group

Input

ParameterTypeRequiredDescription
awsRegionstringYesAWS region (e.g., us-east-1)
awsAccessKeyIdstringYesAWS access key ID
awsSecretAccessKeystringYesAWS secret access key
logGroupNamestringYesCloudWatch log group name
prefixstringNoFilter log streams by name prefix
limitnumberNoMaximum number of log streams to return

Output

ParameterTypeDescription
logStreamsarrayList of log streams with metadata

cloudwatch_list_metrics

List available CloudWatch metrics

Input

ParameterTypeRequiredDescription
awsRegionstringYesAWS region (e.g., us-east-1)
awsAccessKeyIdstringYesAWS access key ID
awsSecretAccessKeystringYesAWS secret access key
namespacestringNoFilter by namespace (e.g., AWS/EC2, AWS/Lambda)
metricNamestringNoFilter by metric name
recentlyActivebooleanNoOnly show metrics active in the last 3 hours
limitnumberNoMaximum number of metrics to return

Output

ParameterTypeDescription
metricsarrayList of metrics with namespace, name, and dimensions

cloudwatch_get_metric_statistics

Get statistics for a CloudWatch metric over a time range

Input

ParameterTypeRequiredDescription
awsRegionstringYesAWS region (e.g., us-east-1)
awsAccessKeyIdstringYesAWS access key ID
awsSecretAccessKeystringYesAWS secret access key
namespacestringYesMetric namespace (e.g., AWS/EC2, AWS/Lambda)
metricNamestringYesMetric name (e.g., CPUUtilization, Invocations)
startTimenumberYesStart time as Unix epoch seconds
endTimenumberYesEnd time as Unix epoch seconds
periodnumberYesGranularity in seconds (e.g., 60, 300, 3600)
statisticsarrayYesStatistics to retrieve (Average, Sum, Minimum, Maximum, SampleCount)
dimensionsstringNoDimensions as JSON (e.g., {"InstanceId": "i-1234"})

Output

ParameterTypeDescription
labelstringMetric label
datapointsarrayDatapoints with timestamp and statistics values

cloudwatch_describe_alarms

List and filter CloudWatch alarms

Input

ParameterTypeRequiredDescription
awsRegionstringYesAWS region (e.g., us-east-1)
awsAccessKeyIdstringYesAWS access key ID
awsSecretAccessKeystringYesAWS secret access key
alarmNamePrefixstringNoFilter alarms by name prefix
stateValuestringNoFilter by alarm state (OK, ALARM, INSUFFICIENT_DATA)
alarmTypestringNoFilter by alarm type (MetricAlarm, CompositeAlarm)
limitnumberNoMaximum number of alarms to return

Output

ParameterTypeDescription
alarmsarrayList of CloudWatch alarms with state and configuration

On this page

Start building today
Trusted by over 100,000 builders.
The open-source platform to build AI agents and run your agentic workforce.
Get started