{"record":{"id":"189100e21bc8f63b","repo":"ComposioHQ/composio","slug":"auth-schema-authscheme-not-found-for-toolkit","errorCode":null,"errorMessage":"Auth schema ${authScheme} not found for toolkit ${toolkitSlug} with auth scheme ${authScheme}","messagePattern":"Auth schema (.+?) not found for toolkit (.+?) with auth scheme (.+?)","errorType":"exception","errorClass":"ComposioAuthConfigNotFoundError","httpStatus":null,"severity":"error","filePath":"ts/packages/core/src/models/Toolkits.ts","lineNumber":228,"sourceCode":"    if (toolkit.authConfigDetails.length > 1 && !authScheme) {\n      logger.warn(\n        `Multiple auth configs found for ${toolkitSlug}, please specify the auth scheme to get details of specific auth scheme. Selecting the first scheme by default.`,\n        {\n          meta: {\n            toolkitSlug,\n          },\n        }\n      );\n    }\n\n    // if authScheme is provided, find the auth config for the given auth scheme\n    // otherwise, use the first auth config\n    const authConfig = authScheme\n      ? toolkit.authConfigDetails.find(authConfig => authConfig.mode === authScheme)\n      : toolkit.authConfigDetails[0];\n\n    if (!authConfig) {\n      throw new ComposioAuthConfigNotFoundError(\n        `Auth schema ${authScheme} not found for toolkit ${toolkitSlug} with auth scheme ${authScheme}`,\n        {\n          meta: {\n            toolkitSlug,\n            authScheme,\n          },\n        }\n      );\n    }\n\n    const requiredFields = authConfig.fields[authConfigType].required.map(field => ({\n      ...field,\n      required: true,\n    }));\n    if (requiredOnly) {\n      return requiredFields;\n    }\n","sourceCodeStart":210,"sourceCodeEnd":246,"githubUrl":"https://github.com/ComposioHQ/composio/blob/64b1b85502b1beeb2379e6c9e8bf1104504fa637/ts/packages/core/src/models/Toolkits.ts#L210-L246","documentation":"Thrown when an explicit authScheme is requested but the toolkit's authConfigDetails contains no entry whose mode matches it. Note the message duplicates the scheme name in both placeholders — it effectively says 'auth scheme X not found for toolkit Y'.","triggerScenarios":"Passing authScheme: 'OAUTH2' (or similar) to getAuthConfigFields via getAuthConfigCreationFields/getConnectedAccountInitiationFields when the toolkit only supports other modes (e.g. only API_KEY), or passing a scheme string with wrong casing/format.","commonSituations":"Hardcoding an expected auth mode for all toolkits in a generic connector; the backend changing a toolkit's supported auth schemes; mismatched enum casing (e.g. 'oauth2' vs 'OAUTH2').","solutions":["Inspect toolkit.authConfigDetails (each entry's mode) and pass one of the actually supported schemes, or omit authScheme to use the first/default scheme.","Re-check the toolkit's auth options in the Composio dashboard; the scheme may have changed.","Upgrade @composio/core so auth scheme metadata is current."],"exampleFix":"// before\nconst fields = await composio.toolkits.getAuthConfigCreationFields('slack', 'OAUTH2');\n\n// after\nconst tk = await composio.toolkits.get({ toolkit: 'slack' });\nconst scheme = tk.authConfigDetails?.find(a => a.mode === 'OAUTH2')?.mode\n  ?? tk.authConfigDetails?.[0]?.mode;\nconst fields = await composio.toolkits.getAuthConfigCreationFields('slack', scheme!);","handlingStrategy":"validation","validationCode":"const tk = await composio.toolkits.get({ toolkit: slug });\nconst scheme = tk.authConfigDetails?.find(a => a.mode === desired)?.mode;\nif (!scheme) throw new Error(`Supported schemes: ${tk.authConfigDetails?.map(a => a.mode).join(', ')}`);","typeGuard":"const supportsScheme = (t: Toolkit, mode: string): boolean =>\n  (t.authConfigDetails ?? []).some(a => a.mode === mode);","tryCatchPattern":"try { ... } catch (e) {\n  if (e instanceof ComposioAuthConfigNotFoundError) { /* fall back to default scheme or prompt user */ }\n}","preventionTips":["Never hardcode a single auth scheme across all toolkits.","Derive the scheme from authConfigDetails at runtime."],"tags":["auth-scheme","toolkit","auth-config","typescript"],"backgroundTag":"unsupported-auth-scheme","analyzedSha":"64b1b85502b1beeb2379e6c9e8bf1104504fa637","analyzedAt":"2026-08-28T15:39:33.623Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}