{"record":{"id":"7cf29fade95c6cd5","repo":"ComposioHQ/composio","slug":"unable-to-retrieve-tool-with-slug-slug","errorCode":null,"errorMessage":"Unable to retrieve tool with slug ${slug}","messagePattern":"Unable to retrieve tool with slug (.+?)","errorType":"exception","errorClass":"ComposioToolNotFoundError","httpStatus":null,"severity":"error","filePath":"ts/packages/core/src/models/Tools.ts","lineNumber":713,"sourceCode":"    options?: ToolRetrievalOptions,\n    requestOptions?: ComposioRequestOptions\n  ): Promise<Tool> {\n    let tool: ToolRetrieveResponse;\n    try {\n      // Build API call parameters based on version source\n      const retrieveParams = options?.version\n        ? { version: options.version } // Explicit version → use 'version' param\n        : { toolkit_versions: this.toolkitVersions }; // SDK config → use 'toolkit_versions' param\n\n      tool = await withCancellation(\n        () => this.client.tools.retrieve(slug, retrieveParams, requestOptions),\n        requestOptions?.signal\n      );\n    } catch (error) {\n      if (error instanceof ComposioRequestCancelledError) {\n        throw error;\n      }\n      throw new ComposioToolNotFoundError(`Unable to retrieve tool with slug ${slug}`, {\n        cause: error,\n      });\n    }\n\n    // change the case of the tool to camel case and apply default modifiers\n    let [modifiedTool] = await this.applyDefaultSchemaModifiers([this.transformToolCases(tool)]);\n    // apply local modifiers if they are provided\n    if (options?.modifySchema) {\n      const modifier = options.modifySchema;\n      if (typeof modifier === 'function') {\n        modifiedTool = await modifier({\n          toolSlug: slug,\n          toolkitSlug: modifiedTool.toolkit?.slug ?? 'unknown',\n          schema: modifiedTool,\n        });\n      } else {\n        throw new ComposioInvalidModifierError('Invalid schema modifier. Not a function.');\n      }","sourceCodeStart":695,"sourceCodeEnd":731,"githubUrl":"https://github.com/ComposioHQ/composio/blob/64b1b85502b1beeb2379e6c9e8bf1104504fa637/ts/packages/core/src/models/Tools.ts#L695-L731","documentation":"ComposioToolNotFoundError thrown by getRawComposioToolBySlug when the backend request to fetch a single tool by slug fails for any non-cancellation reason. The original network/HTTP error is preserved as cause; the message includes the requested slug.","triggerScenarios":"Calling composio.tools.get({ toolSlug }) / getRawToolWithAuthConfigs with a slug that doesn't exist, a typo'd or renamed slug, or when the underlying API call fails (auth, network, 404).","commonSituations":"Slug renamed upstream (e.g. versioned tool slugs like tool_v2), typos in slugs, missing/invalid API key causing the fetch to fail, tool not enabled for the workspace.","solutions":["Verify the slug by listing tools: composio.tools.get({ toolkits: [...] }) or search","Check e.cause for the real underlying HTTP/network error","Confirm API key and that the tool exists in your workspace/environment"],"exampleFix":"// before\nconst tool = await composio.tools.get({ toolSlug: 'github_star' });\n// after\nconst list = await composio.tools.get({ search: 'star' }); // confirm actual slug\nconst tool = await composio.tools.get({ toolSlug: list.items[0].slug });","handlingStrategy":"try-catch","validationCode":"const exists = await composio.tools.get({ search: slug }).then(r => r.items.some(t => t.slug === slug));","typeGuard":"const isToolNotFound = (e: unknown): e is ComposioToolNotFoundError => e instanceof ComposioToolNotFoundError;","tryCatchPattern":"try { const tool = await composio.tools.get({ toolSlug: slug }); } catch (e) { if (isToolNotFound(e)) { console.error(e.cause); /* fallback slug list */ } throw e; }","preventionTips":["Resolve slugs dynamically via search instead of hardcoding","Inspect e.cause to distinguish 404s from auth/network failures"],"tags":["tool-not-found","slug","typescript"],"backgroundTag":"resource-not-found","analyzedSha":"64b1b85502b1beeb2379e6c9e8bf1104504fa637","analyzedAt":"2026-08-28T15:39:33.623Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}