Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.
fix(core): raise tool not found only on 404/400 (#4459)
This PR: - closes [PRDE-1613](https://linear.app/composio/issue/PRDE-1613) - maps only 404/400 from `tools.retrieve` to `ComposioToolNotFoundError`; every other failure (401 invalid API key, 5xx, network) now raises the new `ComposioToolFetchError` with the client error kept as `cause` - `tools.get(userId, slug)` and `tools.execute` inherit the corrected mapping since they call `getRawComposioToolBySlug` - fixes `toolkits.get(slug)`, whose 404/400 check compared against the OpenAI `APIError` class instead of the Composio client one, so `ComposioToolkitNotFoundError` never fired - Python parity: `get_raw_composio_tool_by_slug` raises `ToolNotFoundError` (now a `NotFoundError` subclass) on 404/400 and re-raises any other `composio_client` error unchanged - adds unit tests on both sides for 404, 400, 401 and non-API failures; verified live against the API with an invalid key on both SDKs ## Context An unauthenticated call to `tools.getRawComposioToolBySlug` returned `error.name === "ComposioToolNotFoundError"` while `error.cause.status` was 401. The catch block wrapped every error except cancellation as not-found, which predates the `@composio/client@beta` swap. Intended to be back-ported to `main` after merging to `next`. https://claude.ai/code/session_017HtbhwMAKcfebo8HyXWa5s
No changes.