Use this file to discover all available pages before exploring further.
Tools extend agents with capabilities to interact with external systems, APIs, and services. Agno provides built-in tools and makes it easy to create custom ones.
from agno.agent import Agentfrom agno.tools import tool@tooldef get_weather(city: str) -> str: """Get current weather for a city.""" return f"Weather in {city}: 72°F, sunny"agent = Agent(tools=[get_weather])agent.print_response("What's the weather in San Francisco?")
from agno.agent import Agentfrom agno.tools import tool@tool(show_result=True)def calculate_bmi(weight_kg: float, height_m: float) -> float: """Calculate Body Mass Index.""" return weight_kg / (height_m ** 2)agent = Agent(tools=[calculate_bmi])agent.print_response("Calculate BMI for someone who is 70kg and 1.75m tall")
import asynciofrom agno.agent import Agentfrom agno.tools.mcp import MCPToolsasync def main(): async with MCPTools("npx -y @modelcontextprotocol/server-filesystem .") as mcp: agent = Agent(tools=[mcp]) await agent.aprint_response("What files are in the current directory?")asyncio.run(main())