Skip to main content
Give an Agent a tool and it can search, fetch, and act — pass any Python function or built-in tool through tools=[...].
from praisonaiagents import Agent
from praisonaiagents.tools import duckduckgo

agent = Agent(instructions="Research AI news", tools=[duckduckgo])
agent.start("Find the latest AI news today")

Quick Start

1

Write a tool function

A tool is any typed Python function with a docstring:
from typing import List, Dict

def internet_search_tool(query: str) -> List[Dict]:
    """Search the internet for the given query."""
    from duckduckgo_search import DDGS
    return [
        {"title": r.get("title", ""), "url": r.get("href", ""), "snippet": r.get("body", "")}
        for r in DDGS().text(keywords=query, max_results=5)
    ]
2

Give it to an Agent

from praisonaiagents import Agent

agent = Agent(instructions="Research assistant", tools=[internet_search_tool])
agent.start("AI job trends in 2024")

Inbuild Tools

  • CodeDocsSearchTool
  • CSVSearchTool
  • DirectorySearchTool
  • DirectoryReadTool
  • DOCXSearchTool
  • FileReadTool
  • GithubSearchTool
  • SerperDevTool
  • TXTSearchTool
  • JSONSearchTool
  • MDXSearchTool
  • PDFSearchTool
  • PGSearchTool
  • RagTool
  • ScrapeElementFromWebsiteTool
  • ScrapeWebsiteTool
  • SeleniumScrapingTool
  • WebsiteSearchTool
  • XMLSearchTool
  • YoutubeChannelSearchTool
  • YoutubeVideoSearchTool
Need parameter limits that change at runtime? See Dynamic Tool Schemas to make your tools reflect current configuration.

Example Usage

framework: crewai
topic: research about the causes of lung disease
agents:  # Canonical: use 'agents' instead of 'roles'
  research_analyst:
    instructions: Experienced in analyzing scientific data related to respiratory health.  # Canonical: use 'instructions' instead of 'backstory'
    goal: Analyze data on lung diseases
    role: Research Analyst
    tasks:
      data_analysis:
        description: Gather and analyze data on the causes and risk factors of lung diseases.
        expected_output: Report detailing key findings on lung disease causes.
    tools:
    - WebsiteSearchTool

How It Works

The Agent decides when to call a tool, runs the function, and feeds the result back into the model to complete its answer.

How Tool Names Are Resolved

Pass a tool as a string like tools=["internet_search"] and the core SDK resolves it through a three-step chain, first match wins.
StepSourceWho owns itWhen it wins
1Tool registryTools you register via praisonaiagents.tools.registryYou explicitly registered the name
2TOOL_MAPPINGSBuilt-in lazy tools shipped with praisonaiagents.toolsThe name is a built-in tool
3praisonai-tools packageExternal integrations (pip install praisonai-tools)The name lives in the optional package
An unresolved name is skipped with a warning — it never aborts agent construction:
WARNING praisonaiagents.tools.resolver: Tool 'my_tool' not found (registry, TOOL_MAPPINGS, praisonai-tools)
Graceful skip means a typo or a tool from an uninstalled package no longer crashes your agent — the run continues with the tools that did resolve. Install the missing package (or fix the name) and the next run picks it up.
Resolve names yourself to check before a run:
from praisonaiagents.tools.resolver import resolve_tool_name

tool = resolve_tool_name("internet_search")
print(tool is not None)   # True when it resolved through any of the three steps

Best Practices

Add type hints and a one-line docstring to every tool. The Agent uses these to build the tool schema the model sees.
Give each tool one clear job. Small, single-purpose tools are easier for the model to call correctly.
Import ready-made tools from praisonaiagents.tools before writing your own — for example from praisonaiagents.tools import duckduckgo.
Return lists of dicts or plain strings so the model can read the result. Avoid returning large objects or binary blobs.

Quick Start

Build your first agent with a tool.

Models

Choose the model that calls your tools.