Skip to main content

Overview

CrewAI tools empower agents with capabilities ranging from web searching and data analysis to collaboration and delegating tasks among coworkers. This documentation outlines how to create, integrate, and leverage these tools within the CrewAI framework, including a new focus on collaboration tools.

What is a Tool?

A tool in CrewAI is a skill or function that agents can utilize to perform various actions. This includes tools from the CrewAI Toolkit and LangChain Tools, enabling everything from simple searches to complex interactions and effective teamwork among agents.
CrewAI AMP provides a comprehensive Tools Repository with pre-built integrations for common business systems and APIs. Deploy agents with enterprise tools in minutes instead of days.The Enterprise Tools Repository includes:
  • Pre-built connectors for popular enterprise systems
  • Custom tool creation interface
  • Version control and sharing capabilities
  • Security and compliance features

Key Characteristics of Tools

  • Utility: Crafted for tasks such as web searching, data analysis, content generation, and agent collaboration.
  • Integration: Boosts agent capabilities by seamlessly integrating tools into their workflow.
  • Customizability: Provides the flexibility to develop custom tools or utilize existing ones, catering to the specific needs of agents.
  • Error Handling: Incorporates robust error handling mechanisms to ensure smooth operation.
  • Caching Mechanism: Features intelligent caching to optimize performance and reduce redundant operations.
  • Asynchronous Support: Handles both synchronous and asynchronous tools, enabling non-blocking operations.

Using CrewAI Tools

To enhance your agents’ capabilities with crewAI tools, begin by installing our extra tools package:
Here’s an example demonstrating their use:
Code

Available CrewAI Tools

  • Error Handling: All tools are built with error handling capabilities, allowing agents to gracefully manage exceptions and continue their tasks.
  • Caching Mechanism: All tools support caching, enabling agents to efficiently reuse previously obtained results, reducing the load on external resources and speeding up the execution time. You can also define finer control over the caching mechanism using the cache_function attribute on the tool.
Here is a list of the available tools and their descriptions:
ToolDescription
ApifyActorsToolA tool that integrates Apify Actors with your workflows for web scraping and automation tasks.
BrowserbaseLoadToolA tool for interacting with and extracting data from web browsers.
CodeDocsSearchToolA RAG tool optimized for searching through code documentation and related technical documents.
CodeInterpreterToolA tool for interpreting python code.
ComposioToolEnables use of Composio tools.
CSVSearchToolA RAG tool designed for searching within CSV files, tailored to handle structured data.
DALL-E ToolA tool for generating images using the DALL-E API.
DirectorySearchToolA RAG tool for searching within directories, useful for navigating through file systems.
DOCXSearchToolA RAG tool aimed at searching within DOCX documents, ideal for processing Word files.
DirectoryReadToolFacilitates reading and processing of directory structures and their contents.
EXASearchToolA tool designed for performing exhaustive searches across various data sources.
FileReadToolEnables reading and extracting data from files, supporting various file formats.
FirecrawlSearchToolA tool to search webpages using Firecrawl and return the results.
FirecrawlCrawlWebsiteToolA tool for crawling webpages using Firecrawl.
FirecrawlScrapeWebsiteToolA tool for scraping webpages URL using Firecrawl and returning its contents.
GithubSearchToolA RAG tool for searching within GitHub repositories, useful for code and documentation search.
SerperDevToolA specialized tool for development purposes, with specific functionalities under development.
TXTSearchToolA RAG tool focused on searching within text (.txt) files, suitable for unstructured data.
JSONSearchToolA RAG tool designed for searching within JSON files, catering to structured data handling.
LlamaIndexToolEnables the use of LlamaIndex tools.
MDXSearchToolA RAG tool tailored for searching within Markdown (MDX) files, useful for documentation.
PDFSearchToolA RAG tool aimed at searching within PDF documents, ideal for processing scanned documents.
PGSearchToolA RAG tool optimized for searching within PostgreSQL databases, suitable for database queries.
Vision ToolA tool for generating images using the DALL-E API.
RagToolA general-purpose RAG tool capable of handling various data sources and types.
ScrapeElementFromWebsiteToolEnables scraping specific elements from websites, useful for targeted data extraction.
ScrapeWebsiteToolFacilitates scraping entire websites, ideal for comprehensive data collection.
WebsiteSearchToolA RAG tool for searching website content, optimized for web data extraction.
XMLSearchToolA RAG tool designed for searching within XML files, suitable for structured data formats.
YoutubeChannelSearchToolA RAG tool for searching within YouTube channels, useful for video content analysis.
YoutubeVideoSearchToolA RAG tool aimed at searching within YouTube videos, ideal for video data extraction.

Creating your own Tools

Developers can craft custom tools tailored for their agent’s needs or utilize pre-built options.
There are two main ways for one to create a CrewAI tool:

Subclassing BaseTool

Code

Asynchronous Tool Support

CrewAI supports asynchronous tools, allowing you to implement tools that perform non-blocking operations like network requests, file I/O, or other async operations without blocking the main execution thread.

Creating Async Tools

You can create async tools in two ways:

1. Using the tool Decorator with Async Functions

Code

2. Implementing Async Methods in Custom Tool Classes

Code

Using Async Tools

Async tools work seamlessly in both standard Crew workflows and Flow-based workflows:
Code
The CrewAI framework automatically handles the execution of both synchronous and asynchronous tools, so you don’t need to worry about how to call them differently.

Utilizing the tool Decorator

Code

Custom Caching Mechanism

Tools can optionally implement a cache_function to fine-tune caching behavior. This function determines when to cache results based on specific conditions, offering granular control over caching logic.
Code

Conclusion

Tools are pivotal in extending the capabilities of CrewAI agents, enabling them to undertake a broad spectrum of tasks and collaborate effectively. When building solutions with CrewAI, leverage both custom and existing tools to empower your agents and enhance the AI ecosystem. Consider utilizing error handling, caching mechanisms, and the flexibility of tool arguments to optimize your agents’ performance and capabilities.