Skip to content

Commit f8cbbe7

Browse files
waleedlatif1claude
andcommitted
fix(integrations): validate and fix cloudwatch, cloudformation, athena conventions
- Update tool version strings from '1.0' to '1.0.0' across all three integrations - Add missing `export * from './types'` barrel re-exports (cloudwatch, cloudformation) - Add docsLink, wandConfig timestamps, mode: 'advanced' on optional fields (cloudwatch) - Add dropdown defaults, ZodError handling, docs intro section (cloudwatch) - Add mode: 'advanced' on limit field (cloudformation) - Alphabetize registry entries (cloudwatch, cloudformation) - Fix athena docs maxResults range (1-999) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 044612d commit f8cbbe7

32 files changed

+113
-41
lines changed

apps/docs/content/docs/en/tools/athena.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ Retrieve the results of a completed Athena query execution
113113
| `awsAccessKeyId` | string | Yes | AWS access key ID |
114114
| `awsSecretAccessKey` | string | Yes | AWS secret access key |
115115
| `queryExecutionId` | string | Yes | Query execution ID to get results for |
116-
| `maxResults` | number | No | Maximum number of rows to return \(1-1000\) |
116+
| `maxResults` | number | No | Maximum number of rows to return \(1-999\) |
117117
| `nextToken` | string | No | Pagination token from a previous request |
118118

119119
#### Output

apps/docs/content/docs/en/tools/cloudwatch.mdx

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,24 @@ import { BlockInfoCard } from "@/components/ui/block-info-card"
1010
color="linear-gradient(45deg, #B0084D 0%, #FF4F8B 100%)"
1111
/>
1212

13+
{/* MANUAL-CONTENT-START:intro */}
14+
[AWS CloudWatch](https://aws.amazon.com/cloudwatch/) is a monitoring and observability service that provides data and actionable insights for AWS resources, applications, and services. CloudWatch collects monitoring and operational data in the form of logs, metrics, and events, giving you a unified view of your AWS environment.
15+
16+
With the CloudWatch integration, you can:
17+
18+
- **Query Logs (Insights)**: Run CloudWatch Log Insights queries against one or more log groups to analyze log data with a powerful query language
19+
- **Describe Log Groups**: List available CloudWatch log groups in your account, optionally filtered by name prefix
20+
- **Get Log Events**: Retrieve log events from a specific log stream within a log group
21+
- **Describe Log Streams**: List log streams within a log group, ordered by last event time or filtered by name prefix
22+
- **List Metrics**: Browse available CloudWatch metrics, optionally filtered by namespace, metric name, or recent activity
23+
- **Get Metric Statistics**: Retrieve statistical data for a metric over a specified time range with configurable granularity
24+
- **Publish Metric**: Publish custom metric data points to CloudWatch for your own application monitoring
25+
- **Describe Alarms**: List and filter CloudWatch alarms by name prefix, state, or alarm type
26+
27+
In Sim, the CloudWatch integration enables your agents to monitor AWS infrastructure, analyze application logs, track custom metrics, and respond to alarm states as part of automated DevOps and SRE workflows. This is especially powerful when combined with other AWS integrations like CloudFormation and SNS for end-to-end infrastructure management.
28+
{/* MANUAL-CONTENT-END */}
29+
30+
1331
## Usage Instructions
1432

1533
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.
@@ -155,6 +173,34 @@ Get statistics for a CloudWatch metric over a time range
155173
| `label` | string | Metric label |
156174
| `datapoints` | array | Datapoints with timestamp and statistics values |
157175

176+
### `cloudwatch_put_metric_data`
177+
178+
Publish a custom metric data point to CloudWatch
179+
180+
#### Input
181+
182+
| Parameter | Type | Required | Description |
183+
| --------- | ---- | -------- | ----------- |
184+
| `awsRegion` | string | Yes | AWS region \(e.g., us-east-1\) |
185+
| `awsAccessKeyId` | string | Yes | AWS access key ID |
186+
| `awsSecretAccessKey` | string | Yes | AWS secret access key |
187+
| `namespace` | string | Yes | Metric namespace \(e.g., Custom/MyApp\) |
188+
| `metricName` | string | Yes | Name of the metric |
189+
| `value` | number | Yes | Metric value to publish |
190+
| `unit` | string | No | Unit of the metric \(e.g., Count, Seconds, Bytes\) |
191+
| `dimensions` | string | No | JSON string of dimension name/value pairs |
192+
193+
#### Output
194+
195+
| Parameter | Type | Description |
196+
| --------- | ---- | ----------- |
197+
| `success` | boolean | Whether the metric was published successfully |
198+
| `namespace` | string | Metric namespace |
199+
| `metricName` | string | Metric name |
200+
| `value` | number | Published metric value |
201+
| `unit` | string | Metric unit |
202+
| `timestamp` | string | Timestamp when the metric was published |
203+
158204
### `cloudwatch_describe_alarms`
159205

160206
List and filter CloudWatch alarms

apps/sim/app/(landing)/integrations/data/integrations.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2044,12 +2044,16 @@
20442044
"name": "Get Metric Statistics",
20452045
"description": "Get statistics for a CloudWatch metric over a time range"
20462046
},
2047+
{
2048+
"name": "Publish Metric",
2049+
"description": "Publish a custom metric data point to CloudWatch"
2050+
},
20472051
{
20482052
"name": "Describe Alarms",
20492053
"description": "List and filter CloudWatch alarms"
20502054
}
20512055
],
2052-
"operationCount": 7,
2056+
"operationCount": 8,
20532057
"triggers": [],
20542058
"triggerCount": 0,
20552059
"authType": "none",

apps/sim/app/api/tools/cloudwatch/put-metric-data/route.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,12 @@ export async function POST(request: NextRequest) {
108108
},
109109
})
110110
} catch (error) {
111+
if (error instanceof z.ZodError) {
112+
return NextResponse.json(
113+
{ error: error.errors[0]?.message ?? 'Invalid request' },
114+
{ status: 400 }
115+
)
116+
}
111117
const errorMessage =
112118
error instanceof Error ? error.message : 'Failed to publish CloudWatch metric'
113119
logger.error('PutMetricData failed', { error: errorMessage })

apps/sim/blocks/blocks/cloudformation.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ export const CloudFormationBlock: BlockConfig<
117117
type: 'short-input',
118118
placeholder: '50',
119119
condition: { field: 'operation', value: 'describe_stack_events' },
120+
mode: 'advanced',
120121
},
121122
],
122123
tools: {

apps/sim/blocks/blocks/cloudwatch.ts

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ export const CloudWatchBlock: BlockConfig<
2929
'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.',
3030
category: 'tools',
3131
integrationType: IntegrationType.Analytics,
32+
docsLink: 'https://docs.sim.ai/tools/cloudwatch',
3233
tags: ['cloud', 'monitoring'],
3334
bgColor: 'linear-gradient(45deg, #B0084D 0%, #FF4F8B 100%)',
3435
icon: CloudWatchIcon,
@@ -72,7 +73,6 @@ export const CloudWatchBlock: BlockConfig<
7273
password: true,
7374
required: true,
7475
},
75-
// Query Logs fields
7676
{
7777
id: 'logGroupSelector',
7878
title: 'Log Group',
@@ -127,6 +127,14 @@ Return ONLY the query — no explanations, no markdown code blocks.`,
127127
value: ['query_logs', 'get_log_events', 'get_metric_statistics'],
128128
},
129129
required: { field: 'operation', value: ['query_logs', 'get_metric_statistics'] },
130+
wandConfig: {
131+
enabled: true,
132+
prompt: `Generate a Unix epoch timestamp (in seconds) based on the user's description of a point in time.
133+
134+
Return ONLY the numeric timestamp - no explanations, no quotes, no extra text.`,
135+
placeholder: 'Describe the start time (e.g., "1 hour ago", "beginning of today")...',
136+
generationType: 'timestamp',
137+
},
130138
},
131139
{
132140
id: 'endTime',
@@ -138,16 +146,22 @@ Return ONLY the query — no explanations, no markdown code blocks.`,
138146
value: ['query_logs', 'get_log_events', 'get_metric_statistics'],
139147
},
140148
required: { field: 'operation', value: ['query_logs', 'get_metric_statistics'] },
149+
wandConfig: {
150+
enabled: true,
151+
prompt: `Generate a Unix epoch timestamp (in seconds) based on the user's description of a point in time.
152+
153+
Return ONLY the numeric timestamp - no explanations, no quotes, no extra text.`,
154+
placeholder: 'Describe the end time (e.g., "now", "end of yesterday")...',
155+
generationType: 'timestamp',
156+
},
141157
},
142-
// Describe Log Groups fields
143158
{
144159
id: 'prefix',
145160
title: 'Log Group Name Prefix',
146161
type: 'short-input',
147162
placeholder: '/aws/lambda/',
148163
condition: { field: 'operation', value: 'describe_log_groups' },
149164
},
150-
// Get Log Events / Describe Log Streams — shared log group selector
151165
{
152166
id: 'logGroupNameSelector',
153167
title: 'Log Group',
@@ -170,15 +184,13 @@ Return ONLY the query — no explanations, no markdown code blocks.`,
170184
required: { field: 'operation', value: ['get_log_events', 'describe_log_streams'] },
171185
mode: 'advanced',
172186
},
173-
// Describe Log Streams — stream prefix filter
174187
{
175188
id: 'streamPrefix',
176189
title: 'Stream Name Prefix',
177190
type: 'short-input',
178191
placeholder: '2024/03/31/',
179192
condition: { field: 'operation', value: 'describe_log_streams' },
180193
},
181-
// Get Log Events — log stream selector (cascading: depends on log group)
182194
{
183195
id: 'logStreamNameSelector',
184196
title: 'Log Stream',
@@ -201,7 +213,6 @@ Return ONLY the query — no explanations, no markdown code blocks.`,
201213
required: { field: 'operation', value: 'get_log_events' },
202214
mode: 'advanced',
203215
},
204-
// List Metrics fields
205216
{
206217
id: 'metricNamespace',
207218
title: 'Namespace',
@@ -235,8 +246,8 @@ Return ONLY the query — no explanations, no markdown code blocks.`,
235246
title: 'Recently Active Only',
236247
type: 'switch',
237248
condition: { field: 'operation', value: 'list_metrics' },
249+
mode: 'advanced',
238250
},
239-
// Publish Metric fields
240251
{
241252
id: 'metricValue',
242253
title: 'Value',
@@ -274,7 +285,6 @@ Return ONLY the query — no explanations, no markdown code blocks.`,
274285
columns: ['name', 'value'],
275286
condition: { field: 'operation', value: 'put_metric_data' },
276287
},
277-
// Get Metric Statistics fields
278288
{
279289
id: 'metricPeriod',
280290
title: 'Period (seconds)',
@@ -304,7 +314,6 @@ Return ONLY the query — no explanations, no markdown code blocks.`,
304314
columns: ['name', 'value'],
305315
condition: { field: 'operation', value: 'get_metric_statistics' },
306316
},
307-
// Describe Alarms fields
308317
{
309318
id: 'alarmNamePrefix',
310319
title: 'Alarm Name Prefix',
@@ -322,6 +331,7 @@ Return ONLY the query — no explanations, no markdown code blocks.`,
322331
{ label: 'ALARM', id: 'ALARM' },
323332
{ label: 'INSUFFICIENT_DATA', id: 'INSUFFICIENT_DATA' },
324333
],
334+
value: () => '',
325335
condition: { field: 'operation', value: 'describe_alarms' },
326336
},
327337
{
@@ -333,9 +343,9 @@ Return ONLY the query — no explanations, no markdown code blocks.`,
333343
{ label: 'Metric Alarm', id: 'MetricAlarm' },
334344
{ label: 'Composite Alarm', id: 'CompositeAlarm' },
335345
],
346+
value: () => '',
336347
condition: { field: 'operation', value: 'describe_alarms' },
337348
},
338-
// Shared limit field
339349
{
340350
id: 'limit',
341351
title: 'Limit',
@@ -352,6 +362,7 @@ Return ONLY the query — no explanations, no markdown code blocks.`,
352362
'describe_alarms',
353363
],
354364
},
365+
mode: 'advanced',
355366
},
356367
],
357368
tools: {

apps/sim/tools/athena/create_named_query.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export const createNamedQueryTool: ToolConfig<
1111
id: 'athena_create_named_query',
1212
name: 'Athena Create Named Query',
1313
description: 'Create a saved/named query in AWS Athena',
14-
version: '1.0',
14+
version: '1.0.0',
1515

1616
params: {
1717
awsRegion: {

apps/sim/tools/athena/get_named_query.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export const getNamedQueryTool: ToolConfig<AthenaGetNamedQueryParams, AthenaGetN
66
id: 'athena_get_named_query',
77
name: 'Athena Get Named Query',
88
description: 'Get details of a saved/named query in AWS Athena',
9-
version: '1.0',
9+
version: '1.0.0',
1010

1111
params: {
1212
awsRegion: {

apps/sim/tools/athena/get_query_execution.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export const getQueryExecutionTool: ToolConfig<
1111
id: 'athena_get_query_execution',
1212
name: 'Athena Get Query Execution',
1313
description: 'Get the status and details of an Athena query execution',
14-
version: '1.0',
14+
version: '1.0.0',
1515

1616
params: {
1717
awsRegion: {

apps/sim/tools/athena/get_query_results.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export const getQueryResultsTool: ToolConfig<
1111
id: 'athena_get_query_results',
1212
name: 'Athena Get Query Results',
1313
description: 'Retrieve the results of a completed Athena query execution',
14-
version: '1.0',
14+
version: '1.0.0',
1515

1616
params: {
1717
awsRegion: {

0 commit comments

Comments
 (0)