Implementation:CrewAIInc CrewAI Composio Tool
| Knowledge Sources | |
|---|---|
| Domains | Tools, Integration_Platform, Composio |
| Last Updated | 2026-02-11 00:00 GMT |
Overview
Concrete tool for wrapping Composio actions as CrewAI-compatible tools provided by CrewAI.
Description
The ComposioTool class extends BaseTool to provide access to Composio's extensive action catalog across multiple platforms (GitHub, Gmail, Slack, etc.) by converting Composio actions into CrewAI-compatible tools. The class wraps a Composio action callable and delegates execution through its _run method. It provides two class methods for tool creation: from_action creates a tool from a specific Composio Action by fetching its schema, converting parameters to Pydantic models via json_schema_to_model, and wrapping the execution function with entity ID support; from_app creates multiple tools from an app filtered by either tags or use_case description, using Composio's action discovery methods. The implementation includes _check_connected_account validation to ensure required app authentications exist before tool creation.
Usage
Use this tool when CrewAI agents need to interact with external services (GitHub, Slack, Gmail, etc.) through Composio's pre-built action catalog without implementing custom integrations.
Code Reference
Source Location
- Repository: CrewAI
- File: lib/crewai-tools/src/crewai_tools/tools/composio_tool/composio_tool.py
- Lines: 1-128
Signature
class ComposioTool(BaseTool):
composio_action: t.Callable
def _run(self, *args: t.Any, **kwargs: t.Any) -> t.Any: ...
@classmethod
def from_action(cls, action: t.Any, **kwargs: t.Any) -> te.Self: ...
@classmethod
def from_app(cls, *apps: t.Any, tags: list[str] | None = None,
use_case: str | None = None, **kwargs: t.Any) -> list[te.Self]: ...
Import
from crewai_tools import ComposioTool
I/O Contract
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
| composio_action | Callable | Yes | The Composio action callable to wrap (constructor) |
| action | Action | Yes | Composio Action to create tool from (from_action class method) |
| apps | Any | Yes | One or more Composio app names (from_app class method) |
| tags | list[str] or None | No | Filter actions by tags (from_app, mutually exclusive with use_case) |
| use_case | str or None | No | Filter actions by use case description (from_app, mutually exclusive with tags) |
Outputs
| Name | Type | Description |
|---|---|---|
| _run() returns | Any | Result from executing the wrapped Composio action |
| from_action() returns | ComposioTool | A single CrewAI tool wrapping the specified Composio action |
| from_app() returns | list[ComposioTool] | List of CrewAI tools for the matching app actions |
Usage Examples
Basic Usage
from crewai_tools import ComposioTool
from composio import Action
# Create tool from a specific action
tool = ComposioTool.from_action(Action.GITHUB_CREATE_ISSUE)
# Create tools from an app by use case
tools = ComposioTool.from_app("github", use_case="manage issues")
# Create tools from an app by tags
tools = ComposioTool.from_app("slack", tags=["messaging"])