By Sagar Shankaran, Founder of CallSphere
Extend CrewAI agents with built-in tools like SerperDevTool and ScrapeWebsiteTool, create custom tools using the @tool decorator, and configure tool sharing across multiple agents.
Key takeaways
An agent without tools is limited to what its LLM already knows. It cannot search the web, read files, query databases, or interact with APIs. Tools give agents the ability to take real actions in the world. In CrewAI, tools are Python functions or classes that agents can invoke during their reasoning loop. The agent decides when and how to use them based on the task at hand.
CrewAI provides a rich set of built-in tools through the crewai-tools package and makes it straightforward to build custom ones.
Install the tools package if you have not already:
flowchart TD
GOAL(["Crew goal"])
MGR["Manager agent<br/>hierarchical process"]
R1["Researcher agent<br/>role plus backstory"]
R2["Analyst agent"]
W1["Writer agent"]
T1["Task A<br/>research"]
T2["Task B<br/>analyze"]
T3["Task C<br/>draft"]
TOOLS[("Tools<br/>web search, files")]
OUT(["Crew output"])
GOAL --> MGR
MGR --> T1 --> R1 --> TOOLS
R1 --> T2 --> R2
R2 --> T3 --> W1 --> OUT
style MGR fill:#4f46e5,stroke:#4338ca,color:#fff
style TOOLS fill:#ede9fe,stroke:#7c3aed,color:#1e1b4b
style OUT fill:#059669,stroke:#047857,color:#fff
pip install crewai-tools
The SerperDevTool enables agents to search the web using the Serper API (a Google Search wrapper):
from crewai import Agent
from crewai_tools import SerperDevTool
search_tool = SerperDevTool()
researcher = Agent(
role="Research Analyst",
goal="Find up-to-date information from the web",
backstory="Expert at online research and source verification.",
tools=[search_tool],
)
Set your Serper API key in the environment:
export SERPER_API_KEY="your-serper-key"
The agent will automatically invoke the search tool when it needs current information that is not in its training data.
Hear it before you finish reading
Talk to a live CallSphere AI voice agent in your browser — 60 seconds, no signup.
For reading specific web pages, use ScrapeWebsiteTool:
from crewai_tools import ScrapeWebsiteTool
# General scraper — agent provides the URL
scraper = ScrapeWebsiteTool()
# URL-specific scraper — locked to a single page
doc_scraper = ScrapeWebsiteTool(
website_url="https://docs.crewai.com/introduction"
)
The general version lets the agent scrape any URL it discovers. The URL-specific version restricts it to a single page, which is useful for focused research tasks.
For local file access:
from crewai_tools import FileReadTool, DirectoryReadTool
file_reader = FileReadTool(file_path="./data/report.csv")
dir_reader = DirectoryReadTool(directory="./data/")
data_analyst = Agent(
role="Data Analyst",
goal="Analyze local data files",
backstory="Expert at reading and interpreting structured data.",
tools=[file_reader, dir_reader],
)
CrewAI provides two approaches for building custom tools: the @tool decorator for simple functions and the BaseTool class for complex tools.
The simplest way to create a custom tool:
from crewai.tools import tool
@tool("Calculate Compound Interest")
def compound_interest(principal: float, rate: float, years: int) -> str:
"""Calculate compound interest for a given principal, annual rate, and time period.
Args:
principal: The initial investment amount
rate: Annual interest rate as a decimal (e.g., 0.05 for 5%)
years: Number of years
"""
amount = principal * (1 + rate) ** years
interest = amount - principal
return f"Principal: ${principal:,.2f}, Rate: {rate*100}%, Years: {years}, Final: ${amount:,.2f}, Interest: ${interest:,.2f}"
The docstring is critical. CrewAI uses it to tell the agent what the tool does and what parameters it accepts. A well-written docstring means the agent will use the tool correctly.
For tools that need initialization, state, or complex logic:
from crewai.tools import BaseTool
from pydantic import BaseModel, Field
import httpx
class StockPriceInput(BaseModel):
ticker: str = Field(description="Stock ticker symbol, e.g. AAPL")
class StockPriceTool(BaseTool):
name: str = "Get Stock Price"
description: str = "Fetches the current stock price for a given ticker symbol."
args_schema: type[BaseModel] = StockPriceInput
def _run(self, ticker: str) -> str:
response = httpx.get(
f"https://api.example.com/stock/{ticker}/price",
headers={"Authorization": f"Bearer {self.api_key}"},
)
data = response.json()
return f"{ticker}: ${data['price']:.2f} ({data['change']:+.2f}%)"
The BaseTool approach gives you a Pydantic schema for input validation, which produces better tool descriptions for the LLM and catches parameter errors before execution.
Still reading? Stop comparing — try CallSphere live.
CallSphere ships complete AI voice agents per industry — 14 tools for healthcare, 10 agents for real estate, 4 specialists for salons. See how it actually handles a call before you book a demo.
By default, tools assigned to an agent are private. To share tools across the entire crew, pass them at the crew level:
from crewai import Crew
shared_search = SerperDevTool()
crew = Crew(
agents=[researcher, analyst, writer],
tasks=[research_task, analysis_task, writing_task],
tools=[shared_search],
)
When tools are provided at the crew level, every agent in the crew can access them. Agent-level tools take priority if there is a naming conflict.
Wrap your custom tools with error handling to prevent agent crashes:
@tool("Fetch API Data")
def fetch_api_data(endpoint: str) -> str:
"""Fetch data from the internal API. Args: endpoint: The API path to query."""
try:
response = httpx.get(f"https://api.internal.com/{endpoint}", timeout=10)
response.raise_for_status()
return response.text
except httpx.TimeoutException:
return "Error: API request timed out after 10 seconds."
except httpx.HTTPStatusError as e:
return f"Error: API returned status {e.response.status_code}."
Returning error messages as strings (instead of raising exceptions) allows the agent to reason about the failure and try alternative approaches.
Keep it under 8 to 10 tools per agent. Each tool's description is injected into the agent's context, consuming tokens and potentially confusing the LLM. If an agent needs many capabilities, consider splitting it into multiple specialized agents.
Not directly through CrewAI's tool framework. If you need composed behavior, build it into a single tool function that internally calls multiple APIs or functions. The agent sees it as one tool, keeping the interface clean.
Yes. Tools are provider-agnostic because CrewAI translates them into the standard function-calling format. However, smaller or older models may struggle with complex tool schemas. If you see tool-use errors, simplify your parameter types and improve your docstrings.
#CrewAI #Tools #CustomTools #WebScraping #Python #AgenticAI #LearnAI #AIEngineering

Written by
Sagar Shankaran· Founder, CallSphere
LinkedInSagar Shankaran is the founder of CallSphere, where he builds production AI voice and chat agents deployed across healthcare, hospitality, real estate, and home services. He writes about agentic AI, LLM engineering, and shipping voice agents that handle real calls in production.
See how AI voice agents work for your industry. Live demo available -- no signup required.
Step-by-step build of a working agent with the OpenAI Agents SDK — Agent class, tools, handoffs, tracing — plus an eval pipeline that catches regressions before merge.
A Miami DTC brand uses CrewAI Studio to run a daily merchandising agent crew that updates collections, hero copy, and email sends — and the lift it produced.
Smolagents lets agents write Python instead of JSON. Why code-as-action reduces tool errors and where the security trade-offs are for production deployments.
Enterprise CIO Guide perspective on CrewAI Studio is the visual layer over the most-popular multi-agent framework, opening the toolkit to non-engineers.
SMB Founder Playbook perspective on CrewAI Studio is the visual layer over the most-popular multi-agent framework, opening the toolkit to non-engineers.
An inside look at the Model Context Protocol server ecosystem in 2026 — the official, community, and enterprise servers driving real production agent workloads.
© 2026 CallSphere Inc. All rights reserved.
Made within San Francisco
Watch how CallSphere handles real customer calls, schedules appointments, and processes payments — live.
Try Live DemoBook a DemoCalculate Your ROI