Skip to content

Commit 9cae283

Browse files
committed
fix(athena): cap maxResults at 999 to prevent overflow with header row adjustment
The +1 adjustment for the header row on first-page requests could produce MaxResults=1001 when user requests 1000, exceeding the AWS API hard cap of 1000.
1 parent 5df5e21 commit 9cae283

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

apps/sim/app/api/tools/athena/get-query-results/route.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const GetQueryResultsSchema = z.object({
1414
queryExecutionId: z.string().min(1, 'Query execution ID is required'),
1515
maxResults: z.preprocess(
1616
(v) => (v === '' || v === undefined || v === null ? undefined : v),
17-
z.number({ coerce: true }).int().positive().max(1000).optional()
17+
z.number({ coerce: true }).int().positive().max(999).optional()
1818
),
1919
nextToken: z.string().optional(),
2020
})

apps/sim/tools/athena/get_query_results.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export const getQueryResultsTool: ToolConfig<
4242
type: 'number',
4343
required: false,
4444
visibility: 'user-or-llm',
45-
description: 'Maximum number of rows to return (1-1000)',
45+
description: 'Maximum number of rows to return (1-999)',
4646
},
4747
nextToken: {
4848
type: 'string',

0 commit comments

Comments
 (0)