Implementation:CrewAIInc CrewAI CrewAI Tools Library
Appearance
This is a Wrapper Doc for the crewai-tools library.
Overview
Curated library of 60+ pre-built agent tools for search, scraping, file I/O, databases, and AI services provided by the crewai-tools package.
Source Reference
- Repository: crewAIInc/crewAI
- File:
lib/crewai-tools/src/crewai_tools/__init__.py - Lines: L197-292
Import
from crewai_tools import SerperDevTool, FileReadTool, PDFSearchTool, ...
Tool Categories
Search Tools
| Tool | Provider | Description |
|---|---|---|
SerperDevTool |
Serper.dev | Google search results via the Serper API |
TavilySearchTool |
Tavily | AI-optimized search engine with structured results |
BraveSearchTool |
Brave | Privacy-focused web search |
EXASearchTool |
EXA | Neural search engine for semantic queries |
Scraping Tools
| Tool | Approach | Description |
|---|---|---|
ScrapeWebsiteTool |
HTTP | Simple HTTP-based web page content extraction |
FirecrawlScrapeWebsiteTool |
Managed service | Scraping via the Firecrawl managed service |
SeleniumScrapingTool |
Browser automation | JavaScript-rendered page scraping via Selenium |
File I/O Tools
| Tool | Description |
|---|---|
FileReadTool |
Read the contents of a file from the local filesystem |
FileWriterTool |
Write content to a file on the local filesystem |
PDFSearchTool |
Search and extract content from PDF documents |
DirectoryReadTool |
List files and directories within a path |
Database Tools
| Tool | Database | Description |
|---|---|---|
MySQLSearchTool |
MySQL | Execute queries against a MySQL database |
PGSearchTool |
PostgreSQL | Execute queries against a PostgreSQL database |
SnowflakeSearchTool |
Snowflake | Query a Snowflake data warehouse |
Code Tools
| Tool | Description |
|---|---|
CodeInterpreterTool |
Execute Python code in a sandboxed environment and return results |
RAG Tools
| Tool | Description |
|---|---|
CSVSearchTool |
Semantic search over CSV file contents |
JSONSearchTool |
Semantic search over JSON file contents |
MDXSearchTool |
Semantic search over MDX/Markdown documents |
Example
Importing and Configuring Common Tools
import os
from crewai import Agent
from crewai_tools import (
SerperDevTool,
FileReadTool,
PDFSearchTool,
ScrapeWebsiteTool,
)
# Configure API keys via environment variables
os.environ["SERPER_API_KEY"] = "your-serper-api-key"
# Instantiate built-in tools
search_tool = SerperDevTool()
file_reader = FileReadTool()
pdf_search = PDFSearchTool(pdf="reports/annual_report.pdf")
scraper = ScrapeWebsiteTool()
# Assign tools to an agent
research_agent = Agent(
role="Research Analyst",
goal="Find and analyze information from multiple sources",
backstory="An experienced analyst skilled at gathering data.",
tools=[search_tool, file_reader, pdf_search, scraper],
)
Using Database Tools
from crewai_tools import PGSearchTool
# Configure a PostgreSQL search tool
pg_tool = PGSearchTool(
db_uri="postgresql://user:password@localhost:5432/mydb",
)
# The agent can now query the database using natural language
db_agent = Agent(
role="Data Analyst",
goal="Query the database to answer business questions",
backstory="An analyst with deep SQL expertise.",
tools=[pg_tool],
)
Installation
# Install the tools package separately
pip install crewai-tools
# Or install crewai with tools extras
pip install crewai[tools]
Principle Link
Principle:CrewAIInc_CrewAI_Built_In_Tool_Selection
See Also
- Implementation:CrewAIInc_CrewAI_BaseTool_Schema -- The base class all built-in tools extend
- Implementation:CrewAIInc_CrewAI_Tool_Decorator_And_Classes -- The patterns used to implement these tools
- Implementation:CrewAIInc_CrewAI_Tool_Assignment_Config -- How to assign built-in tools to agents and tasks
- Environment:CrewAIInc_CrewAI_Optional_Provider_Dependencies
Page Connections
Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment