Usage
Access this class through thecomposio.tools property:
Methods
execute()
Executes a given tool with the provided parameters. This method calls the Composio API to execute the tool and returns the response. Version Control: By default, manual tool execution requires a specific toolkit version. If the version resolves to “latest”, the execution will throw aComposioToolVersionRequiredError unless dangerouslySkipVersionCheck is set to true. This helps prevent unexpected behavior when new toolkit versions are released.
Returns
Promise<ToolExecuteResponse> — The response from the tool execution
Example
executeSessionTool()
Executes a tool based on a tool router session.
Returns
Promise<ToolExecuteResponse> — The response from the tool execution
get()
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. Overload 1
Returns
Promise<ReturnType<T['wrapTools']>> — The wrapped tools collection
Overload 2
Returns
Promise<ReturnType<T['wrapTools']>> — The wrapped tool
Example
getInput()
Generates arguments for a tool from a natural-language description of the task. Composio uses an LLM to fill the tool’s input parameters fromtext. Review the generated arguments before passing them to tools.execute().
Returns
Promise<ToolGetInputResponse> — The generated arguments, or an error when generation fails
Example
getRawComposioToolBySlug()
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 thetoolkitVersions configuration. Local experimental custom tools are session-scoped; attach them when creating or reusing a Tool Router session, then use session.tools(), session.customTools(), or session.execute().
Returns
Promise<Tool> — The requested tool with its complete schema and metadata
Example
getRawComposioTools()
Lists Composio API tools available to the SDK. This method fetches remote Composio tools from the API in raw format. The response can be filtered and modified as needed. Local experimental custom tools are session-scoped; attach them when creating or reusing a Tool Router session, then usesession.tools(), session.customTools(), or session.execute(). It provides access to the underlying tool data without provider-specific wrapping.
Returns
Promise<ToolList> — List of tools matching the query criteria
Example
getRawToolRouterSessionTools()
Fetches tools exposed by a tool router session. This includes helper/meta tools plus any tools preloaded into the session. It provides access to the underlying tool data without provider-specific wrapping.
Returns
Promise<ToolList> — The list of session tools
Example
getToolsEnum()
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()
Sends an HTTP request to a toolkit’s API, authenticated as a connected account. Use it to call an endpoint that no predefined tool covers. Composio injects the connected account’s credentials on the server side. A relativeendpoint is appended to the toolkit’s base URL, and that base URL can already include a path. Google Calendar’s base URL is https://www.googleapis.com/calendar/v3, so pass /users/me/calendarList, not /calendar/v3/users/me/calendarList (which resolves to /calendar/v3/calendar/v3/... and returns a 404 from Google). An absolute URL on the same domain is sent as-is.
Returns
Promise<ToolProxyResponse> — The upstream status, headers, and parsed body
Example