Properly log function-based tool calls in your AI agent traces
@tool
from atla_insights import tool @tool def get_weather(location: str) -> str: """Get current weather for a location""" # Your weather API implementation api_key = "your-weather-api-key" response = weather_api.get_current(location, api_key) return f"Weather in {location}: {response.condition}, {response.temperature}°F" @tool def search_database(query: str) -> str: """Search the company database""" # Your database search implementation results = db.search(query) return f"Found {len(results)} results: {results[:3]}" @tool def send_email(to: str, subject: str, body: str) -> str: """Send an email""" # Your email implementation email_service.send(to=to, subject=subject, body=body) return f"Email sent to {to}"