custom_tools_example.py
from dotenv import load_dotenv
load_dotenv()

from xpander_sdk import Backend, register_tool
from agno.agent import Agent

@register_tool 
def weather_check(location: str) -> str:
    """Check weather for a location"""
    return f"Weather in {location}: Sunny, 25°C"

backend = Backend()
agno_agent = Agent(**backend.get_args())

agno_agent.print_response(message="What's the weather in Tel Aviv?")

How to Run

custom_tools_example.py
python custom_tools_example.py
This example shows automatic tool discovery where the agent recognizes it needs weather information, calls the custom weather_check tool seamlessly during conversation, and uses the tool’s response to provide a complete answer. Tools are registered with type hints and docstrings that help the AI understand their purpose and usage.

Production Deployment

For creating and deploying agents to production, see the Setup and Deployment Guide.