1. File & Document Tools
CrewAI’s file and document tools enable agents to read, search, and process various file formats. These are essential for building document processing pipelines, knowledge extraction crews, and content analysis workflows.
crewai-tools package. Install with pip install crewai-tools or pip install 'crewai[tools]' to get all built-in tools.
1.1 Document Processing Crew
from crewai import Agent, Task, Crew
from crewai_tools import (
FileReadTool,
DirectoryReadTool,
PDFSearchTool,
CSVSearchTool,
TXTSearchTool
)
# File reading tools
file_reader = FileReadTool() # Read any file content
dir_reader = DirectoryReadTool(directory="./documents") # List directory contents
pdf_search = PDFSearchTool(pdf="./reports/annual-report.pdf") # Search within PDFs
csv_search = CSVSearchTool(csv="./data/sales.csv") # Search CSV data
txt_search = TXTSearchTool(txt="./notes/meeting-notes.txt") # Search text files
# Document processing agent
doc_analyst = Agent(
role="Document Analyst",
goal="Extract key insights from business documents",
backstory="Expert at analyzing documents and extracting actionable information",
tools=[file_reader, dir_reader, pdf_search, csv_search, txt_search],
verbose=True
)
analysis_task = Task(
description="""Analyze all documents in the ./documents folder:
1. List all available files
2. Search the PDF for revenue figures
3. Search the CSV for top-performing products
4. Compile a summary of key findings""",
expected_output="A structured summary with key data points from all documents",
agent=doc_analyst
)
crew = Crew(agents=[doc_analyst], tasks=[analysis_task])
result = crew.kickoff()
print(result.raw)
| Tool | Purpose | Key Parameters |
|---|---|---|
FileReadTool | Read any file content | file_path |
DirectoryReadTool | List directory contents | directory |
PDFSearchTool | Semantic search within PDFs | pdf |
DOCXSearchTool | Search Word documents | docx |
CSVSearchTool | Search CSV data | csv |
TXTSearchTool | Search plain text files | txt |
MDXSearchTool | Search MDX/Markdown | mdx |
2. Web Scraping & Search Tools
Web tools allow agents to search the internet, scrape websites, and browse pages dynamically. These are critical for research crews and real-time information gathering.
2.1 Research Crew with Web Tools
from crewai import Agent, Task, Crew
from crewai_tools import (
SerperDevTool,
ScrapeWebsiteTool,
WebsiteSearchTool
)
# Search tools — SerperDevTool requires SERPER_API_KEY env var
web_search = SerperDevTool() # Google search via Serper API
scraper = ScrapeWebsiteTool() # Scrape any URL content
site_search = WebsiteSearchTool() # Semantic search within a website
# Research agent with full web capabilities
researcher = Agent(
role="Senior Research Analyst",
goal="Find comprehensive, accurate information from the web",
backstory="""Expert researcher who cross-references multiple sources
and validates information before including it in reports.""",
tools=[web_search, scraper, site_search],
verbose=True
)
# Fact-checker with limited tools
fact_checker = Agent(
role="Fact Checker",
goal="Verify claims and check source credibility",
backstory="Meticulous fact-checker who ensures accuracy",
tools=[web_search, scraper],
verbose=True
)
research_task = Task(
description="Research the current state of quantum computing in 2026. Find the top 3 companies, latest breakthroughs, and market size estimates.",
expected_output="Detailed research report with sources and citations",
agent=researcher
)
verify_task = Task(
description="Verify the key claims from the research report. Check at least 2 facts.",
expected_output="Verification report confirming or correcting claims",
agent=fact_checker,
context=[research_task]
)
crew = Crew(agents=[researcher, fact_checker], tasks=[research_task, verify_task])
result = crew.kickoff()
print(result.raw)
SerperDevTool needs SERPER_API_KEY. BrowserbaseLoadTool needs BROWSERBASE_API_KEY. Set these as environment variables before using.
3. Database & Data Tools
Database tools enable agents to query structured data stores. They support PostgreSQL, MySQL, and structured data formats like JSON and XML.
3.1 Data Analysis Agent
from crewai import Agent, Task, Crew
from crewai_tools import (
PGSearchTool,
JSONSearchTool
)
# PostgreSQL semantic search (requires connection config)
pg_tool = PGSearchTool(
db_uri="postgresql://user:pass@localhost:5432/mydb",
table_name="products"
)
# JSON search tool
json_tool = JSONSearchTool(json_path="./data/inventory.json")
# Data analyst agent
data_analyst = Agent(
role="Data Analyst",
goal="Extract insights from structured data sources",
backstory="""Senior data analyst with expertise in SQL, JSON processing,
and statistical analysis. Produces clear, actionable insights.""",
tools=[pg_tool, json_tool],
verbose=True
)
analysis_task = Task(
description="""Analyze the product database:
1. Find the top 5 products by revenue
2. Search JSON inventory for low-stock items
3. Identify trends and make recommendations""",
expected_output="Data analysis report with findings and recommendations",
agent=data_analyst
)
crew = Crew(agents=[data_analyst], tasks=[analysis_task])
result = crew.kickoff()
print(result.raw)
| Tool | Database | Key Feature |
|---|---|---|
PGSearchTool | PostgreSQL | Semantic search over table rows |
MySQLSearchTool | MySQL | Semantic search over MySQL data |
JSONSearchTool | JSON files | Search structured JSON documents |
XMLSearchTool | XML files | Query XML document content |
Automated Market Research
A market research firm uses 12 CrewAI tools together: SerperDev for web search, ScrapeWebsite for competitor pages, PDFSearch for industry reports, CSV tools for data analysis, and DALL-E for chart generation. Their research crew produces reports that previously took analysts 3 days in under 2 hours.
4. AI/ML & Cloud Tools
AI tools extend agent capabilities with image generation, vision analysis, and code interpretation. Cloud tools provide access to object storage services.
4.1 AI-Powered Tool Agent
from crewai import Agent, Task, Crew
from crewai_tools import DallETool, VisionTool
# Image generation tool (requires OPENAI_API_KEY)
dalle_tool = DallETool(model="dall-e-3", size="1024x1024", quality="standard")
# Vision analysis tool
vision_tool = VisionTool()
# Creative agent with AI tools
creative_agent = Agent(
role="Creative Director",
goal="Create and analyze visual content for marketing campaigns",
backstory="""Award-winning creative director with expertise in
visual storytelling and brand design. Uses AI tools to prototype
ideas quickly.""",
tools=[dalle_tool, vision_tool],
verbose=True
)
creative_task = Task(
description="""Create a marketing campaign concept:
1. Generate an image for a tech startup's landing page hero
2. The image should convey 'innovation' and 'simplicity'
3. Describe the generated image and suggest how to use it""",
expected_output="Generated image description with usage recommendations",
agent=creative_agent
)
crew = Crew(agents=[creative_agent], tasks=[creative_task])
result = crew.kickoff()
print(result.raw)
5. Integrations & Automation
Integration tools connect CrewAI to external platforms like GitHub, Slack, and 200+ apps via Composio. These enable agents to interact with real-world systems and automate cross-platform workflows.
5.1 Integrated Automation Crew
from crewai import Agent, Task, Crew
from crewai_tools import GithubSearchTool
from composio_crewai import ComposioToolSet, App
# GitHub code search tool
github_tool = GithubSearchTool(
github_repo="https://github.com/crewAIInc/crewAI",
content_types=["code", "issue"]
)
# Composio for 200+ integrations (Slack, Notion, Gmail, etc.)
composio_toolset = ComposioToolSet()
slack_tools = composio_toolset.get_tools(apps=[App.SLACK])
notion_tools = composio_toolset.get_tools(apps=[App.NOTION])
# DevOps automation agent
devops_agent = Agent(
role="DevOps Automation Engineer",
goal="Automate development workflows across platforms",
backstory="""Expert in CI/CD, automation, and cross-platform integrations.
Connects tools and services to create efficient workflows.""",
tools=[github_tool] + slack_tools + notion_tools,
verbose=True
)
automation_task = Task(
description="""Automate the release workflow:
1. Search GitHub for the latest merged PRs this week
2. Create a release summary
3. Post the summary to the #releases Slack channel
4. Update the Notion release tracker page""",
expected_output="Confirmation that all automation steps completed successfully",
agent=devops_agent
)
crew = Crew(agents=[devops_agent], tasks=[automation_task])
result = crew.kickoff()
print(result.raw)
pip install composio-crewai and authenticate each app via composio login CLI.
| Category | Tools | Use Case |
|---|---|---|
| Version Control | GithubSearchTool | Search code, issues, PRs |
| Communication | Composio: Slack, Teams, Discord | Post messages, read channels |
| Project Mgmt | Composio: Notion, Jira, Linear | Create/update tasks and pages |
| Composio: Gmail, Outlook | Send/read emails | |
| CRM | Composio: Salesforce, HubSpot | Manage contacts and deals |
| Cloud | S3, GCS tools | Upload/download files |
Next in the CrewAI SDK Track
In Part 8: MCP Integration, we’ll connect Model Context Protocol servers to CrewAI agents using the simple DSL syntax, explore Stdio and SSE transports, and implement secure multi-server configurations.