Skip to main content

Tools

Tools are the fundamental building blocks of the Composio SDK. They represent individual actions that can be executed on third-party services, such as creating a GitHub repository, sending a Slack message, or retrieving Hacker News data.

Overview

The Tools class manages tool operations in the Composio SDK. It provides methods to list, retrieve, and execute tools, along with support for custom tools and execution modifiers. Source: ts/packages/core/src/models/Tools.ts

Listing Tools

Get Tools from Toolkits

Retrieve tools from specific toolkits with optional filtering:
When fetching tools by toolkit without specifying tools, tags, search, or limit parameters, the SDK automatically sets important: true to return only the most commonly used tools.

Get Specific Tools

Search for Tools

Filter by Authentication

Retrieving a Single Tool

Fetch a specific tool by its slug:

Getting Provider-Wrapped Tools

The get method fetches tools and wraps them in provider-specific format:

Executing Tools

Basic Execution

By default, manual tool execution requires a specific toolkit version. If the version resolves to “latest”, execution will throw a ComposioToolVersionRequiredError unless dangerouslySkipVersionCheck is set to true.

Version Control Options

Execution with Modifiers

Modifiers allow you to transform inputs and outputs during tool execution:

Tool Schema Modification

Transform tool schemas before using them:

Tool Properties

Every tool has the following key properties:
  • slug - Unique identifier (e.g., ‘GITHUB_GET_REPOS’)
  • name - Human-readable name
  • description - Tool description
  • inputParameters - JSON Schema for input parameters
  • outputParameters - JSON Schema for output response
  • toolkit - Associated toolkit information
  • version - Current tool version
  • availableVersions - List of available versions
  • isDeprecated - Whether the tool is deprecated
  • isNoAuth - Whether authentication is required
  • tags - Categorization tags

Advanced Features

Tool Router Meta Tools

Fetch meta tools for tool router sessions:

Execute Meta Tools

Proxy Execute

Send custom requests to toolkits:

Get Tool Input Parameters

Get All Available Tools

Auto File Upload/Download

The SDK supports automatic file handling for tools that work with files:
When autoUploadDownloadFiles is enabled, the SDK automatically uploads files before execution and downloads result files after execution.

Error Handling

Common errors when working with tools:
  • ComposioToolNotFoundError - Tool with the given slug doesn’t exist
  • ComposioToolVersionRequiredError - Version resolves to “latest” and dangerouslySkipVersionCheck is not true
  • ComposioToolExecutionError - Error during tool execution
  • ValidationError - Invalid parameters passed to tool methods
  • ComposioProviderNotDefinedError - Provider not configured when initializing Tools