ComposioHQ/composio · error · ComposioToolkitFetchError
Failed to fetch toolkits
Error message
Failed to fetch toolkits
What it means
getToolkits() wraps its entire body in a try/catch and converts any non-cancellation failure (network error, APIError, or unexpected exception) into ComposioToolkitFetchError with the original as cause. It rethrows ComposioRequestCancelledError untouched so aborted requests are not misclassified. Hitting it means the toolkit list endpoint could not be fetched to completion.
Source
Thrown at ts/packages/core/src/models/Toolkits.ts:81
}
const listParams = {
category: parsedQuery.data.category,
managed_by: parsedQuery.data.managedBy,
sort_by: parsedQuery.data.sortBy,
cursor: parsedQuery.data.cursor,
limit: parsedQuery.data.limit,
};
const result = await withCancellation(
() => this.client.toolkits.list(listParams, requestOptions),
requestOptions?.signal
);
return transformToolkitListResponse(result);
} catch (error) {
if (error instanceof ComposioRequestCancelledError) {
throw error;
}
throw new ComposioToolkitFetchError('Failed to fetch toolkits', {
cause: error,
});
}
}
/**
* Retrieves a specific toolkit by its slug identifier.
*
* This method fetches a single toolkit from the Composio API and transforms
* the response to use camelCase property naming consistent with JavaScript/TypeScript conventions.
*
* @param {string} slug - The unique slug identifier of the toolkit to retrieve
* @returns {Promise<ToolkitRetrieveResponse>} The transformed toolkit object
* @throws {ValidationError} If the response cannot be properly parsed
* @throws {ComposioToolNotFoundError} If no toolkit with the given slug exists
*
* @private
*/
protected async getToolkitBySlug(View on GitHub (pinned to 64b1b85502)
Solutions
- Verify the API key and base URL configuration are correct
- Inspect error.cause: APIError.status reveals 401/403 vs 5xx vs TypeError (network)
- Retry with backoff for transient 5xx/network failures
- Check the Composio status page for ongoing incidents
Defensive patterns
Strategy: retry
Type guard
const isToolkitFetchError = (e: unknown): e is ComposioToolkitFetchError => e instanceof ComposioToolkitFetchError;
Try / catch
try { const list = await composio.toolkits.get(query); } catch (e) {
if (e instanceof ComposioRequestCancelledError) throw e;
if (e instanceof ComposioToolkitFetchError) { const status = (e.cause as any)?.status; if (status >= 500 || !status) { /* retry with backoff */ } else throw e; }
} Prevention
- Validate API key and base URL at app startup
- Wrap listing calls in retry with exponential backoff for 5xx/network causes
- Distinguish e.cause.status codes before retrying blindly
When it happens
Trigger: composio.toolkits.get() when the network is down, the API key is rejected (401), the API returns 5xx, or a request timeout/abort that is not a explicit cancellation.
Common situations: Invalid or expired API key, wrong base URL / environment, regional outage, or flaky connectivity during listing.
Related errors
- Toolkit with slug ${slug} not found
- Failed to fetch file: ${response.statusText}
- Error downloading file: {_sanitize_url_for_logging(self.s3ur
- Failed to list MCP servers
- Failed to update MCP server {server_id}
AI-assisted analysis of ComposioHQ/composio@64b1b85502 (2026-08-28).
Data as JSON: /api/errors/9430c6fa697cfd46.
Report an issue: GitHub.