ComposioHQ/composio · error · ComposioToolkitNotFoundError
TOOLKIT_NOT_FOUND
TOOLKIT_NOT_FOUND
Error message
Toolkit not found
What it means
ComposioToolkitNotFoundError (code TOOLKIT_NOT_FOUND): thrown when a toolkit lookup by slug fails — the backend returned no matching toolkit. It carries suggested fixes (valid slug, correct configuration) as part of the structured ComposioError.
Source
Thrown at ts/packages/core/src/errors/ToolkitErrors.ts:14
import { ComposioError, ComposioErrorOptions } from './ComposioError';
export const ToolkitErrorCodes = {
TOOLKIT_NOT_FOUND: 'TOOLKIT_NOT_FOUND',
} as const;
export class ComposioToolkitNotFoundError extends ComposioError {
constructor(
message: string = 'Toolkit not found',
options: Omit<ComposioErrorOptions, 'code' | 'statusCode'> = {}
) {
super(message, {
...options,
code: 'TOOLKIT_NOT_FOUND',
possibleFixes: options.possibleFixes || [
'Ensure the toolkit is correctly configured and the slug is valid',
],
});
this.name = 'ComposioToolkitNotFoundError';
}
}
export class ComposioToolkitFetchError extends ComposioError {
constructor(
message: string = 'Failed to fetch toolkit',
options: Omit<ComposioErrorOptions, 'code' | 'statusCode'> = {}
) {
super(message, {
...options,
code: 'TOOLKIT_FETCH_ERROR',
possibleFixes: options.possibleFixes || [
'Ensure the toolkit slug is valid',View on GitHub (pinned to 64b1b85502)
Solutions
- Verify the slug against the toolkit list (composio.toolkits.list())
- Check for typos, casing, and hyphenation of the slug
- Confirm the toolkit exists in your workspace/region and plan
- Catch ComposioToolkitNotFoundError by code for graceful degradation
Example fix
// before
const tk = await composio.toolkits.get('gihub');
// after
const all = await composio.toolkits.list();
const slug = all.items.find(t => t.name?.toLowerCase().includes('github'))?.slug;
const tk = await composio.toolkits.get(slug!); Defensive patterns
Strategy: try-catch
Validate before calling
const slugs = (await composio.toolkits.list()).items.map(t => t.slug); if (!slugs.includes(mySlug)) chooseAnother();
Type guard
import { ComposioToolkitNotFoundError } from '@composio/core/errors';
const isNotFound = (e: unknown): boolean => e instanceof ComposioToolkitNotFoundError; Try / catch
try { const tk = await composio.toolkits.get(slug); } catch (e) { if (e instanceof ComposioToolkitNotFoundError) handleMissing(slug); else throw e; } Prevention
- Validate slugs against toolkits.list() in dynamic tool selection
- Prefer IDE autocomplete over hand-typed slugs
When it happens
Trigger: Calling toolkit-getting APIs (getToolkit, toolkit(slug) with an unknown/wrong slug; typos like 'githubg'; referencing a toolkit not available on your workspace/plan or region.
Common situations: Typos in toolkit slugs; toolkits renamed or deprecated across API versions; environment mismatch (staging slugs vs production); custom toolkits not yet created.
Understand the failure class
Background: 'Could not be found', 'does not exist', 'not found in database': the resource-not-found family when an ID, slug, key, or URI lookup comes back empty — this error's family across 20 libraries.
Related errors
- TOOLKIT_FETCH_ERROR
- Couldn't fetch Toolkit with slug: ${slug}
- Could not determine a home directory to store the Composio c
- Request timed out fetching URL: {_sanitize_url_for_logging(u
- Failed to fetch file from URL: {_sanitize_url_for_logging(ur
AI-assisted analysis of ComposioHQ/composio@64b1b85502 (2026-08-28).
Data as JSON: /api/errors/8b64606a5c5d9da0.
Report an issue: GitHub.