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.Tools give agents callable functions to take action. They work alongside MCPs (remote tool servers), Apps (platform integrations), Skills (domain expertise), and Knowledge (retrieved facts). See the Agent Capabilities overview to understand when to use each.
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.
- Typed Outputs: Uses optional Pydantic models to give agents clear JSON fields while direct Python calls still receive the tool’s normal return value.
Using CrewAI Tools
To enhance your agents’ capabilities with crewAI tools, begin by installing our extra tools package: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_functionattribute on the tool.
Creating your own Tools
There are two main ways for one to create a CrewAI tool:Subclassing BaseTool
Code
Typed Tool Outputs
When a tool returns structured data, define a Pydantic output model. This gives the agent field names it can trust, such assku, quantity, or needs_reorder.
Direct Python calls still receive the value your tool returns. When an agent uses the tool, CrewAI sends the agent a JSON string based on the output model.
Code
format_output_for_agent. Direct calls to tool.run(...) still return the normal Python value.
Code
format_output_for_agent, typed outputs are sent to the agent as JSON. Plain string results work as before.
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
Utilizing the tool Decorator
Code
Custom Caching Mechanism
Code
Reporting Tool Failures
A tool can finish without raising and still fail to do what it was asked. Slack answersHTTP 200 with {"ok": false, "error": "channel_not_found"}; an MCP
server sets isError; a platform action returns an error payload. The tool call
“worked”, so the error text reaches the agent as an ordinary result — the agent
narrates the problem in its final answer and the run is recorded as a success.
Return a ToolFailure instead of an error string and the framework can tell the
difference:
Code
ToolFailure.as_agent_message() renders the
message — so model behavior is unchanged. What changes is that the failure is now
visible to everything downstream.
Detection is strictly declarative. CrewAI never guesses whether a string “looks
like” an error, so a tool that legitimately returns text about an error is never
misread as having failed. Failures are recorded when a tool returns a
ToolFailure, when a tool raises, when an MCP server sets isError, when a
tool’s max_usage_count is spent, or when the agent calls a tool that does not exist.
Choosing a Failure Policy
tool_failure_policy controls what happens next:
Code
warn. Every
level defaults to None, meaning “inherit from the next one out”, so the
effective default with nothing configured anywhere is warn.
Inspecting Failures
Recorded failures are structured, so nothing downstream has to parse a string:Code
tool_failures is available on TaskOutput, CrewOutput, and
LiteAgentOutput. A crew can finish successfully with a non-empty list — check
it before treating raw as complete.
To react as failures happen, subscribe to the event:
Code
raise policy aborts, so subscribers always
observe the failure. ToolUsageFinishedEvent also carries a failure field, letting
a trace UI mark the call as failed without correlating two events.
