Tools
@composio/core / models/Tools / Tools
Class: Tools<TToolCollection, TTool, TProvider>
Defined in: ts/packages/core/src/models/Tools.ts:57
This class is used to manage tools in the Composio SDK. It provides methods to list, get, and execute tools.
Type Parameters
TToolCollection
TToolCollection
TTool
TTool
TProvider
TProvider
extends BaseComposioProvider
<TToolCollection
, TTool
, unknown
>
Constructors
Constructor
new Tools<
TToolCollection
,TTool
,TProvider
>(client
,provider
,config?
):Tools
<TToolCollection
,TTool
,TProvider
>
Defined in: ts/packages/core/src/models/Tools.ts:68
Parameters
client
Composio
provider
TProvider
config?
ComposioConfig
<TProvider
>
Returns
Tools
<TToolCollection
, TTool
, TProvider
>
Methods
createCustomTool()
createCustomTool<
T
>(body
):Promise
<{ }>
Defined in: ts/packages/core/src/models/Tools.ts:978
Creates a custom tool that can be used within the Composio SDK.
Custom tools allow you to extend the functionality of Composio with your own implementations while keeping a consistent interface for both built-in and custom tools.
Type Parameters
T
T
extends CustomToolInputParameter
Parameters
body
CustomToolOptions
<T
>
The configuration for the custom tool
Returns
Promise
<{ }>
The created custom tool
Examples
get()
Get a tool or list of tools based on the provided arguments. This is an implementation method that handles all overloads.
Param
The user id to get the tool(s) for
Param
Either a slug string or filters object
Param
Optional provider options or version string
Param
Optional provider options (when arg3 is version)
Call Signature
get<
T
>(userId
,filters
,options?
):Promise
<ReturnType
<T
["wrapTools"
]>>
Defined in: ts/packages/core/src/models/Tools.ts:562
Get a list of tools from Composio based on filters. This method fetches the tools from the Composio API and wraps them using the provider.
Type Parameters
T
T
extends BaseComposioProvider
<TToolCollection
, TTool
, unknown
>
Parameters
userId
string
The user id to get the tools for
filters
ToolListParams
The filters to apply when fetching tools
options?
ProviderOptions
<TProvider
>
Optional provider options including modifiers
Returns
Promise
<ReturnType
<T
["wrapTools"
]>>
The tool collection
Param
The user id to get the tool(s) for
Param
Either a slug string or filters object
Param
Optional provider options or version string
Param
Optional provider options (when arg3 is version)
Example
Call Signature
get<
T
>(userId
,slug
,options?
):Promise
<ReturnType
<T
["wrapTools"
]>>
Defined in: ts/packages/core/src/models/Tools.ts:591
Get a specific tool by its slug. This method fetches the tool from the Composio API and wraps it using the provider.
Type Parameters
T
T
extends BaseComposioProvider
<TToolCollection
, TTool
, unknown
>
Parameters
userId
string
The user id to get the tool for
slug
string
The slug of the tool to fetch
options?
ProviderOptions
<TProvider
>
Optional provider options including modifiers
Returns
Promise
<ReturnType
<T
["wrapTools"
]>>
The tool collection
Param
The user id to get the tool(s) for
Param
Either a slug string or filters object
Param
Optional provider options or version string
Param
Optional provider options (when arg3 is version)
Example
getInput()
getInput(
slug
,body
):Promise
<ToolGetInputResponse
>
Defined in: ts/packages/core/src/models/Tools.ts:873
Fetches the input parameters for a given tool.
This method is used to get the input parameters for a tool before executing it.
Parameters
slug
string
The ID of the tool to find input for
body
ToolGetInputParams
The parameters to be passed to the tool
Returns
Promise
<ToolGetInputResponse
>
The input parameters schema for the specified tool
Example
getRawComposioToolBySlug()
getRawComposioToolBySlug(
slug
,options?
):Promise
<{ }>
Defined in: ts/packages/core/src/models/Tools.ts:488
Retrieves a specific tool by its slug from the Composio API.
This method fetches a single tool in raw format without provider-specific wrapping,
providing direct access to the tool’s schema and metadata. Tool versions are controlled
at the Composio SDK initialization level through the toolkitVersions
configuration.
Parameters
slug
string
The unique identifier of the tool (e.g., ‘GITHUB_GET_REPOS’)
options?
SchemaModifierOptions
Optional configuration for tool retrieval
Returns
Promise
<{ }>
The requested tool with its complete schema and metadata
Example
getRawComposioTools()
getRawComposioTools(
query
,options?
):Promise
<ToolList
>
Defined in: ts/packages/core/src/models/Tools.ts:348
Lists all tools available in the Composio SDK including custom tools.
This method fetches tools from the Composio API in raw format and combines them with any registered custom tools. The response can be filtered and modified as needed. It provides access to the underlying tool data without provider-specific wrapping.
Parameters
query
ToolListParams
Query parameters to filter the tools (required)
options?
SchemaModifierOptions
Optional configuration for tool retrieval
Returns
Promise
<ToolList
>
List of tools matching the query criteria
Example
getToolsEnum()
getToolsEnum():
Promise
<ToolRetrieveEnumResponse
>
Defined in: ts/packages/core/src/models/Tools.ts:851
Fetches the list of all available tools in the Composio SDK.
This method is mostly used by the CLI to get the list of tools. No filtering is done on the tools, the list is cached in the backend, no further optimization is required.
Returns
Promise
<ToolRetrieveEnumResponse
>
The complete list of all available tools with their metadata
Example
proxyExecute()
proxyExecute(
body
):Promise
<ToolProxyResponse
>
Defined in: ts/packages/core/src/models/Tools.ts:900
Proxies a custom request to a toolkit/integration.
This method allows sending custom requests to a specific toolkit or integration when you need more flexibility than the standard tool execution methods provide.
Parameters
body
The parameters for the proxy request including toolkit slug and custom data
Returns
Promise
<ToolProxyResponse
>
The response from the proxied request