Skip to main content

How to Add Built-in Tools

1

List Available Tools

praisonai tools list
2

Add Tools to agents.yaml

# agents.yaml
framework: praisonai
topic: "{{task}}"

roles:
  researcher:
    role: Research Agent
    goal: Research topics thoroughly
    tools:
      - internet_search
      - shell_tool
      - file_read_tool
    tasks:
      search_task:
        description: "Search for {{topic}}"
3

Run Recipe

praisonai recipe run ./my-recipe --var topic="AI agents"

How to Add Custom Tools via tools.py

1

Create tools.py in Recipe Directory

# tools.py
def my_custom_tool(query: str) -> str:
    """Custom tool that processes a query.
    
    Args:
        query: The input query to process
        
    Returns:
        Processed result as string
    """
    return f"Processed: {query}"

def another_tool(data: str) -> dict:
    """Another custom tool.
    
    Args:
        data: Input data
        
    Returns:
        Dictionary with results
    """
    return {"result": data, "status": "success"}
2

Reference in agents.yaml

roles:
  processor:
    role: Data Processor
    tools:
      - my_custom_tool
      - another_tool
    tasks:
      process_task:
        description: "Process the data"
3

Run Recipe

praisonai recipe run ./my-recipe

Tool Resolution Order

PrioritySourceDescription
1tools.pyRecipe-local tools.py
2Built-inpraisonaiagents built-in tools
3Packagepraisonai_tools package