{"record":{"id":"92ed562ac65c3b81","repo":"ComposioHQ/composio","slug":"failed-to-parse-toolkit-list-query","errorCode":null,"errorMessage":"Failed to parse toolkit list query","messagePattern":"Failed to parse toolkit list query","errorType":"validation","errorClass":"ValidationError","httpStatus":null,"severity":"error","filePath":"ts/packages/core/src/models/Toolkits.ts","lineNumber":60,"sourceCode":"  /**\n   * Retrieves a list of toolkits based on the provided query parameters.\n   *\n   * This method fetches toolkits from the Composio API and transforms the response\n   * from snake_case to camelCase format for consistency with JavaScript/TypeScript conventions.\n   *\n   * @param {ToolkitListParams} query - The query parameters to filter toolkits\n   * @returns {Promise<ToolKitListResponse>} The transformed list of toolkits\n   *\n   * @private\n   */\n  private async getToolkits(\n    query: ToolkitListParams,\n    requestOptions?: ComposioRequestOptions\n  ): Promise<ToolKitListResponse> {\n    try {\n      const parsedQuery = ToolkitsListParamsSchema.safeParse(query);\n      if (!parsedQuery.success) {\n        throw new ValidationError('Failed to parse toolkit list query', {\n          cause: parsedQuery.error,\n        });\n      }\n      const listParams = {\n        category: parsedQuery.data.category,\n        managed_by: parsedQuery.data.managedBy,\n        sort_by: parsedQuery.data.sortBy,\n        cursor: parsedQuery.data.cursor,\n        limit: parsedQuery.data.limit,\n      };\n      const result = await withCancellation(\n        () => this.client.toolkits.list(listParams, requestOptions),\n        requestOptions?.signal\n      );\n\n      return transformToolkitListResponse(result);\n    } catch (error) {\n      if (error instanceof ComposioRequestCancelledError) {","sourceCodeStart":42,"sourceCodeEnd":78,"githubUrl":"https://github.com/ComposioHQ/composio/blob/64b1b85502b1beeb2379e6c9e8bf1104504fa637/ts/packages/core/src/models/Toolkits.ts#L42-L78","documentation":"getToolkits() validates its query argument with ToolkitsListParamsSchema before fetching. If the query object contains invalid values (unknown categories, wrong-typed flags like managedBy), a ValidationError wrapping the Zod issues is thrown. This is a fail-fast check on caller input.","triggerScenarios":"Calling composio.toolkits.get({ ... }) with a category string not in the allowed set, managedBy of the wrong type, or other schema-violating query fields.","commonSituations":"Passing a typo'd or deprecated category (e.g. 'CRM ' or an old name after the category enum changed), or copying query params from an older SDK version.","solutions":["Check error.cause (ZodError) for the exact failing field and allowed values","Correct the category/managedBy values to the current allowed enums","Update @composio/core in case the allowed category list expanded"],"exampleFix":"// before\nawait composio.toolkits.get({ category: 'DEFAULt' } as any);\n// after\nawait composio.toolkits.get({ category: 'default' });","handlingStrategy":"validation","validationCode":"const r = ToolkitsListParamsSchema.safeParse(query);\nif (!r.success) throw new Error(r.error.issues.map(i => `${i.path.join('.')}: ${i.message}`).join('; '));\nreturn composio.toolkits.get(r.data);","typeGuard":"const isToolkitQuery = (q: unknown): q is { category?: string; managedBy?: string } =>\n  typeof q === 'object' && q !== null &&\n  Object.values(q).every(v => v === undefined || typeof v === 'string');","tryCatchPattern":"try { await composio.toolkits.get(query); } catch (e) { if (e instanceof ValidationError) { for (const i of e.cause?.issues ?? []) console.error(i.path, i.message); } throw e; }","preventionTips":["Use the exported schema to pre-validate query objects","List valid categories once and validate user input against them"],"tags":["validation","zod","toolkits","query-params","typescript"],"backgroundTag":"schema-validation-failed","analyzedSha":"64b1b85502b1beeb2379e6c9e8bf1104504fa637","analyzedAt":"2026-08-28T15:39:33.623Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}