Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.
Mirrored from https://github.com/Camo67/composio.git
Synced Nov 21, 04:45 UTC
| 1 | const REMOTE_CUSTOM_PREFIX = 'CUSTOM_'; |
| 2 | |
| 3 | /** |
| 4 | * Whether a toolkit slug names a project-scoped custom MCP toolkit (e.g. `custom_grain`). |
| 5 | * |
| 6 | * These toolkits are served by the Tool Router session, not the REST tools index. |
| 7 | * Native toolkits whose slug merely starts with "custom" (`customerio`, `customgpt`, ...) |
| 8 | * do not match, because they lack the `custom_` separator. |
| 9 | */ |
| 10 | export const isRemoteCustomToolkitSlug = (slug: string): boolean => { |
| 11 | const normalized = slug.toUpperCase(); |
| 12 | return ( |
| 13 | normalized.startsWith(REMOTE_CUSTOM_PREFIX) && normalized.length > REMOTE_CUSTOM_PREFIX.length |
| 14 | ); |
| 15 | }; |
| 16 | |
| 17 | /** |
| 18 | * Whether a tool slug belongs to a remote custom toolkit (e.g. `CUSTOM_GRAIN_SEARCH_PERSONS`). |
| 19 | * Tool slugs carry their toolkit slug as a prefix, so the toolkit predicate applies directly. |
| 20 | */ |
| 21 | export const isRemoteCustomToolSlug = (slug: string): boolean => isRemoteCustomToolkitSlug(slug); |