Skip to content

Commit 7b4922f

Browse files
committed
Fix since param
1 parent f5c1d8d commit 7b4922f

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

src/tools/atlas/read/getPerformanceAdvisor.ts

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,11 @@ export class GetPerformanceAdvisorTool extends AtlasToolBase {
3131
.default(PerformanceAdvisorOperationType.options)
3232
.describe("Operations to get performance advisor recommendations"),
3333
since: z
34-
.date()
35-
.describe("Date to get slow query logs since. Only relevant for the slowQueryLogs operation.")
34+
.string()
35+
.datetime()
36+
.describe(
37+
"Date to get slow query logs since. Must be a string in ISO 8601 format. Only relevant for the slowQueryLogs operation."
38+
)
3639
.optional(),
3740
namespaces: z
3841
.array(z.string())
@@ -57,7 +60,13 @@ export class GetPerformanceAdvisorTool extends AtlasToolBase {
5760
? getDropIndexSuggestions(this.session.apiClient, projectId, clusterName)
5861
: Promise.resolve(undefined),
5962
operations.includes("slowQueryLogs")
60-
? getSlowQueries(this.session.apiClient, projectId, clusterName, since, namespaces)
63+
? getSlowQueries(
64+
this.session.apiClient,
65+
projectId,
66+
clusterName,
67+
since ? new Date(since) : undefined,
68+
namespaces
69+
)
6170
: Promise.resolve(undefined),
6271
operations.includes("schemaSuggestions")
6372
? getSchemaAdvice(this.session.apiClient, projectId, clusterName)

0 commit comments

Comments
 (0)