fix(tools): coerce limit/offset in ai-sdk schemas (#1202)

Co-authored-by: Dhravya Shah <dhravyashah@gmail.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Haroon 2026-07-11 08:12:15 +05:30 committed by GitHub
parent 5567e82377
commit e5e4e498f2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -40,11 +40,11 @@ export const searchMemoriesTool = (
.default(DEFAULT_VALUES.includeFullDocs)
.describe(PARAMETER_DESCRIPTIONS.includeFullDocs),
limit: strict
? z
? z.coerce
.number()
.default(DEFAULT_VALUES.limit)
.describe(PARAMETER_DESCRIPTIONS.limit)
: z
: z.coerce
.number()
.optional()
.default(DEFAULT_VALUES.limit)
@ -183,16 +183,16 @@ export const documentListTool = (
.optional()
.describe(PARAMETER_DESCRIPTIONS.containerTag),
limit: strict
? z
? z.coerce
.number()
.default(DEFAULT_VALUES.limit)
.describe(PARAMETER_DESCRIPTIONS.limit)
: z
: z.coerce
.number()
.optional()
.default(DEFAULT_VALUES.limit)
.describe(PARAMETER_DESCRIPTIONS.limit),
page: z.number().optional().describe(PARAMETER_DESCRIPTIONS.page),
page: z.coerce.number().optional().describe(PARAMETER_DESCRIPTIONS.page),
}),
execute: async ({ containerTag, limit, page }) => {
try {