| Feature | Knowledge | Tools |
|---|---|---|
| Purpose | Static reference information | Dynamic interaction capabilities |
| Access | Read-only reference | Execute actions and commands |
| Updates | Manual through files | Real-time through tool calls |
| Storage | Knowledge base | Assigned to specific agents |
| Persistence | Permanent until changed | Available during agent execution |
Quick Start
Tools are functions that agents can use to interact with external systems and perform actions. They are essential for creating agents that can do more than just process text.Creating Custom Tool
1
Create any function that you want to use as a tool, that performs a specific task.
2
Assign the tool to an agent
That's it!
You have created a custom tool and assigned it to an agent.
Implementing Tools Full Code Example
- Code
- No Code
1
Install PraisonAI
Install the core package:
Terminal
2
3
Create Agent with Tool
Create
app.py4
Start Agents
Execute your script:
Terminal
MCP Tools (Model Context Protocol)
MCP allows agents to use external tools via standardized protocols. This is the recommended way to add powerful tools to your agents.MCP Overview
Introduction to Model Context Protocol
MCP Transports
stdio, HTTP, WebSocket, and SSE transports
Built-in Search Tools
PraisonAI includes built-in search tools that work with multiple providers:Tavily
AI-optimized search with web search, news, and content extraction
You.com
Web search with AI-powered results
Exa
Neural search for finding similar content
Fast Context (Code Search)
Fast Context provides rapid parallel code search for AI agents - 10-20x faster than traditional methods:Fast Context
Rapid parallel code search with caching and multi-language support
In-build Tools in PraisonAI
Search Tools
Tools for searching and retrieving information from various sources
Tavily Tools
AI-optimized web search, news, and content extraction
You.com Tools
Web search with AI-powered results
Exa Tools
Neural search for finding similar content
Python Tools
Essential Python utilities for data manipulation and scripting
Spider Tools
Web crawling and scraping capabilities for data extraction
Arxiv Tools
Access and search academic papers from arXiv repository
Newspaper Tools
Extract and parse content from news articles and websites
DuckDB Tools
Fast analytical SQL database operations and queries
DuckDuckGo Tools
Web search functionality using DuckDuckGo’s API
SearxNG Tools
Privacy-focused web search using local SearxNG instance
Calculator Tools
Perform mathematical calculations and conversions
YAML Tools
Parse and manipulate YAML format data
JSON Tools
Handle JSON data structures and operations
Pandas Tools
Data analysis and manipulation using Pandas
YFinance Tools
Fetch financial market data from Yahoo Finance
Shell Tools
Execute shell commands and system operations
Wikipedia Tools
Access and search Wikipedia articles and data
XML Tools
Process and manipulate XML format data
File Tools
File system operations and management utilities
Excel Tools
Work with Excel spreadsheets and workbooks
CSV Tools
Handle CSV file operations and transformations
Tools Overview
Search Tools
Tools for searching and retrieving information from various sources
File Tools
Tools for reading, writing, and manipulating files
API Tools
Tools for interacting with external APIs and services
Advanced Tool Features
Tool Configuration
Tool Chaining
Tool Categories
Data Collection Tools
- Web scraping
- API integration
- Database queries
Processing Tools
- Data transformation
- Text analysis
- Image processing
Output Tools
- File generation
- Report creation
- Data visualization
Tool Integration
Adding Tools to Agents
Tool Dependencies
Tool Guidelines
Best Practices
-
Type Hints
- Use Python type hints
- Define clear input/output types
- Document complex types
-
Documentation
- Write clear docstrings
- Explain parameters
- Provide usage examples
-
Error Handling
- Handle exceptions gracefully
- Return meaningful errors
- Validate inputs
Tool Types
-
Search Tools
- Web search
- Database queries
- Document search
-
File Tools
- Read/write operations
- File conversion
- Data extraction
-
API Tools
- REST API calls
- GraphQL queries
- Service integration
Best Practices Summary
Following these best practices will help you create robust, efficient, and secure tools in PraisonAI.
Design Principles
Single Responsibility
Single Responsibility
Each tool should have one clear purpose and do it well. Avoid creating tools that try to do too many things.
Clear Interfaces
Clear Interfaces
Define explicit input/output types and maintain consistent parameter naming.
Documentation
Documentation
Always include detailed docstrings and type hints.
Performance Optimization
Efficient Processing
Efficient Processing
Optimize resource usage and processing time.
Resource Management
Resource Management
Properly handle resource allocation and cleanup.
Caching
Caching
Implement caching for frequently accessed data.
Async Operations
Async Operations
Use async/await for I/O-bound operations.
Security Best Practices
Input Validation
Input Validation
Always validate and sanitize inputs to prevent security vulnerabilities.
Rate Limiting
Rate Limiting
Implement rate limiting for API calls to prevent abuse.
API Key Management
API Key Management
Securely handle API keys and credentials using environment variables.
Error Masking
Error Masking
Hide sensitive information in error messages to prevent information leakage.

