{"record":{"id":"cb4a8719b858b9b5","repo":"ComposioHQ/composio","slug":"composiotoolversionrequirederror","errorCode":null,"errorMessage":"ComposioToolVersionRequiredError","messagePattern":"ComposioToolVersionRequiredError","errorType":"exception","errorClass":"ComposioToolVersionRequiredError","httpStatus":null,"severity":"error","filePath":"ts/packages/core/src/models/Tools.ts","lineNumber":986,"sourceCode":"  }\n\n  /**\n   * @internal\n   * Executes a composio tool via API without modifiers\n   * @param tool - The tool to execute\n   * @param body - The body of the tool execution\n   * @returns The response from the tool execution\n   */\n  private async executeComposioTool(\n    tool: Tool,\n    body: ToolExecuteParams,\n    requestOptions?: ComposioRequestOptions\n  ): Promise<ToolExecuteResponse> {\n    const toolkitVersion =\n      body.version ?? getToolkitVersion(tool.toolkit?.slug ?? 'unknown', this.toolkitVersions);\n    // if the version is latest and dangerouslySkipVersionCheck is not true, throw an error\n    if (toolkitVersion === 'latest' && !body.dangerouslySkipVersionCheck) {\n      throw new ComposioToolVersionRequiredError();\n    }\n    try {\n      const executeBody: ComposioToolExecuteParams = {\n        allow_tracing: body.allowTracing,\n        connected_account_id: body.connectedAccountId,\n        custom_auth_params: body.customAuthParams\n          ? {\n              base_url: body.customAuthParams.baseURL,\n              body: body.customAuthParams.body,\n              parameters: body.customAuthParams.parameters,\n            }\n          : undefined,\n        /**\n         * @deprecated The `customConnectionData` execute param is deprecated and will be\n         * removed in a future release. Use `customAuthParams` instead.\n         */\n        custom_connection_data:\n          body.customConnectionData as ComposioToolExecuteParams['custom_connection_data'],","sourceCodeStart":968,"sourceCodeEnd":1004,"githubUrl":"https://github.com/ComposioHQ/composio/blob/64b1b85502b1beeb2379e6c9e8bf1104504fa637/ts/packages/core/src/models/Tools.ts#L968-L1004","documentation":"ComposioToolVersionRequiredError is thrown by Tools.execute when the resolved toolkit version is 'latest' and dangerouslySkipVersionCheck is not set. The version resolves from body.version ?? getToolkitVersion(tool.toolkit.slug, this.toolkitVersions). The SDK refuses to execute against a floating 'latest' toolkit because tool schemas can change without notice, breaking pinned integrations.","triggerScenarios":"Calling tools.execute(...) where body.version is omitted (or literally 'latest') AND no concrete version for that toolkit slug is registered in toolkitVersions — i.e. getToolkitVersion returns 'latest' — while body.dangerouslySkipVersionCheck is falsy.","commonSituations":"Upgrading to an SDK version that enforces version pinning; using a toolkit whose version was never fetched/cached; toolkit slug missing on the tool object so it falls back to 'unknown' and the version lookup misses; copying older examples that omit version.","solutions":["Pass an explicit version in the execute body: version: '<toolkit-version>' (from the tool's toolkit metadata or your toolkitVersions cache)","Ensure a concrete version for the toolkit slug is populated in the toolkitVersions map passed to the Tools model so getToolkitVersion resolves it","If you deliberately want floating latest, set dangerouslySkipVersionCheck: true in the execute body to acknowledge the risk"],"exampleFix":"// before\nawait composio.tools.execute({ tool, arguments, connectedAccountId });\n\n// after\nawait composio.tools.execute({ tool, arguments, connectedAccountId, version: '14.0.0' });\n// or opt out explicitly:\nawait composio.tools.execute({ tool, arguments, connectedAccountId, dangerouslySkipVersionCheck: true });","handlingStrategy":"validation","validationCode":"const version =\n  body.version ?? toolkitVersions.get(tool.toolkit?.slug ?? 'unknown');\nif (!version || version === 'latest') {\n  // pin a known version or explicitly opt in\n  body.version = '14.0.0'; // or body.dangerouslySkipVersionCheck = true;\n}","typeGuard":"const hasPinnedVersion = (t: { toolkit?: { slug?: string; version?: string } } | undefined): boolean =>\n  Boolean(t?.toolkit?.version && t.toolkit.version !== 'latest');","tryCatchPattern":"try {\n  await tools.execute(params);\n} catch (e) {\n  if (e instanceof ComposioToolVersionRequiredError) {\n    // fetch toolkit version, retry with body.version pinned\n  }\n}","preventionTips":["Fetch and cache toolkit versions at startup and pass version on every execute","Treat resolving to 'latest' as a production smell — pin explicitly","Reserve dangerouslySkipVersionCheck for dev/experimental code"],"tags":["composio","toolkit-version","version-pinning","tool-execution","typescript"],"backgroundTag":"version-pinning-required","analyzedSha":"64b1b85502b1beeb2379e6c9e8bf1104504fa637","analyzedAt":"2026-08-28T15:39:33.623Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}