Tools Guide

Complete guide to working with PraisonAI tools

Next

Tools let agents read data, call APIs, and run code—this hub links every tools how-to.

python
from praisonaiagents import Agent, tool

@tool
def ping() -> str:
    """Health check tool."""
    return "pong"

agent = Agent(name="Tools Intro", tools=[ping])
agent.start("Run the ping tool.")

The user follows a tools guide, attaches capabilities to agents, and validates behaviour with doctor.

Diagram

Tools

📋 @tool

🔧 Agent

✅ Action

Quick Start

  1. Simple Usage

    Decorate a function with @tool and hand it to an agent.

    python
    from praisonaiagents import Agent, tool
    
    @tool
    def ping() -> str:
        """Health check tool."""
        return "pong"
    
    agent = Agent(name="Tools Intro", tools=[ping])
    agent.start("Run the ping tool.")
  2. With Configuration

    Add tools from a package or file with the CLI, then verify resolution.

    bash
    praisonai tools add ./my_tools.py
    praisonai tools doctor

How It Works

Diagram
ToolAgentUserToolAgentUserAsk something that needs an actionCall the resolved toolReturn valueAnswer using the tool result

Tools Guides

Learn how to create, configure, debug, and manage tools in PraisonAI.

Quick Reference

TaskCommand
List toolspraisonai tools list
Add packagepraisonai tools add pandas
Add filepraisonai tools add ./my_tools.py
Add from GitHubpraisonai tools add github:user/repo
Add sourcepraisonai tools add-sources <source>
Get infopraisonai tools info <name>
Searchpraisonai tools search <query>
Doctorpraisonai tools doctor
Resolvepraisonai tools resolve <name>
Discoverpraisonai tools discover
Show sourcespraisonai tools show-sources

Best Practices

Decorate functions with @tool

@tool registers a function as agent-callable and reads its type hints and docstring to build the schema — the fastest path to a working tool.

Type-hint every parameter and return

The model relies on type hints to call tools correctly. Include them, plus a JSON-serializable return type.

Verify with tools doctor before shipping

praisonai tools doctor walks the full resolver chain, so it confirms a tool is reachable before an agent tries to call it.