This handbook provides a comprehensive overview of all tools available to agents within the epic_news project, including native CrewAI tools, custom-built tools, and integrations from the Composio library.
Factory Pattern: Use factory functions to organize and provide tools. This allows for centralized management and easy modification.
Domain Separation: Group tools by functionality into separate files (e.g., web_tools.py, finance_tools.py, github_tools.py).
Graceful Degradation: If a tool fails to initialize (e.g., missing API key), the factory should handle it gracefully (e.g., return an empty list) so the application can proceed without it.
# Example: src/epic_news/tools/web_tools.pydefget_search_tools():return[PerplexitySearchTool()]# Example: graceful degradation (src/epic_news/tools/github_tools.py)defget_github_tools()->list[BaseTool]:ifnotos.getenv("GITHUB_TOKEN"):return[]# tool unavailable without a tokenreturn[GitHubSearchTool()]
Asynchronous Execution: Enable async for independent, I/O-bound tasks.
Caching: Implement caching for expensive or frequently repeated API calls.
Testing: Write unit tests for tool factories and integration tests for tool combinations. Mock external APIs to avoid costs and dependencies during testing.
What it does: Centralizes selection of the web scraper provider via src/epic_news/tools/scraper_factory.py::get_scraper().
Default: ScrapeNinjaTool.
Switching providers: Set WEB_SCRAPER_PROVIDER in your .env to scrapeninja (default) or firecrawl.
Required keys:
RAPIDAPI_KEY for ScrapeNinja
FIRECRAWL_API_KEY for Firecrawl
Usage example:
fromepic_news.tools.scraper_factoryimportget_scraperscraper=get_scraper()# selected by WEB_SCRAPER_PROVIDERresult_json=scraper.run({"url":"https://example.com"})
recent_search: Perplexity web search limited to the last 12 months (search_recency="year"), JSON result; on failure returns a JSON error telling the agent to use hybrid_search. Used by PESTEL.
PERPLEXITY_API_KEY
EXASearchTool
CrewAI
Specialized search with similarity functions.
EXA_API_KEY
BrowserbaseLoadTool
CrewAI
Browser-based content loading for dynamic sites.
BROWSERBASE_API_KEY
YoutubeVideoSearchTool
CrewAI
Finds relevant video content on YouTube.
YouTube API Key
PerplexityAI
Composio
Natural language search with sophisticated AI models.
PERPLEXITY_API_KEY
SeleniumScrapingTool
CrewAI
Browser automation for JS-heavy sites. (ScrapeNinja is preferred).
No MCP servers are used. Wikipedia, formerly an MCP server for deep_research
and pestel, now comes from the in-process WikipediaSearchTool and
WikipediaArticleTool (see the table above).