🛠️ What are Tools & Actions?
Learn about tools in Composio
What are tools?
Large Language Models (LLMs) are like a highly intelligent person who can understand and reason about almost anything but is sitting in an empty room with no ability to interact with the outside world. They can think and talk about sending emails, creating a ticket on Jira, or cloning a repository from GitHub, but can’t actually DO these things.
This is where tools come in. Tools give this intelligent being specific abilities to interact with the real world. Many AI models support tool calling (also called function calling).
The term tools and actions are used interchangeably in the documentation
How tool calling works
AI models with tool calling capabilities decide when and how to use specific tools to meet user requests. Developers create and provide these tools, equipping the AI with a toolbox to select the best tool for each task
For example, if a user asks an LLM to send an email to john@example.com
with subject Meeting Tomorrow
, the LLM can use the Gmail tool’s GMAIL_SEND_EMAIL
action to send the email.
LLM’s thinking process:
- Recognizes this requires email sending capability
- Identifies the appropriate tool (Gmail) & action (
GMAIL_SEND_EMAIL
) - Structures the necessary parameters:
- recipient: john@example.com
- subject: “Meeting Tomorrow”
- body: [drafts appropriate content]
- Calls the action with these parameters
Tool calling with Composio
At Composio, tools are offered for multiple platforms, accessible via Python and JavaScript SDKs. These platforms, referred to as Apps or Tools, include popular services like GitHub, Twitter, Salesforce, Jira, and Notion. Within each of these Apps, we provide Actions, which are essentially functions that can be executed. For example, you can send an email on Gmail, star a repository on GitHub, or create an issue on Jira. These tools can also be used directly, similar to function calls, without needing agents.
Use the ComposioToolSet
class to use and configure tools:
- Use composio-core package for non-agentic use cases
- Use framework-specific packages composio-langchain or composio-crewai when working with Agentic frameworks
See all supported frameworks here.
Arguments Accepted by ComposioToolSet
Basic Uscase:
api_key
: Composio API key. Get your API key hereentity_id
: The ID of the entity to execute the action on. Defaults to defaultconnected_account_ids
: Use this to define connected accounts to use when executing an action for a specific app
Extensive Use Case:
output_dir
: Directory path to store downloaded filesmetadata
: Additional metadata for executing an action. Learn more hereprocessors
: Request and response processors, use these to pre-process requests before executing an action and post-process the response after an action has been executed. Learn more herelogging_level
: Accepted values: CRITICAL, FATAL, ERROR, WARNING, WARN, INFO, DEBUGverbosity_level
: This defines the size of the log object that will be printed on the console
Advanced Use Case:
base_url
: Base URL for the Composio API serveroutput_in_file
: Whether to output the result to a fileworkspace_id
: Workspace ID for loading an existing workspaceworkspace_config
: Used to specify the configuration for the workspace environment. Supported workspace types: Host, Docker, FlyIO, and E2Bmax_retries
: Maximum number of times a tool should be retried in case of a failure during execution**kwargs
: Additional arguments for advanced use cases
Getting Tools & Actions
Install packages
Get tools
Action Types
- External Tool Actions: Pre-configured actions for specific tools, such as creating issues or changing issue status in Jira.
- System Management Actions: Actions that interact with the execution environment, like file system operations, shell commands, and browser automation.
- Custom Actions: User-defined actions in Python or JavaScript that extend Composio’s capabilities to interact with new or existing tools.
Action Limits
Empirical evidence indicates that agents perform optimally when limited to fewer than 20 actions. Providing LLMs with too many actions can lead to significant performance issues, such as increased response time and decreased accuracy.
To optimize agent performance, it’s essential to limit the number of actions available. This can be achieved through effective action filtering strategies. Here are some recommended approaches:
- Use specific actions from a tool
- Use tags to filter actions
- Use use cases to filter actions
- Implement custom filtering logic
By carefully curating the action set, you can significantly improve agent efficiency and response quality.
Listing All Apps (Tools)
You can list all available tools in Composio along with their details in the following ways:
Listing All Actions
You can list all available actions in Composio along with their details in the following ways:
Was this page helpful?