Tools are functions agents call to interact with external systems.
Tools are what make agents capable of real-world action. While LLMs alone can only generate text, agents equipped with tools can search the web, run queries, send emails, call APIs, and perform any action you define.
from definable.agent import Agentfrom definable.tool.decorator import tool@tooldef get_weather(city: str) -> str: """Get the current weather for a city.""" return f"The weather in {city} is sunny, 72F."agent = Agent( model="gpt-4o", tools=[get_weather],)output = agent.run("What's the weather in San Francisco?")print(output.content)
The @tool decorator converts any Python function into an agent-callable tool. Definable automatically generates the JSON Schema from type hints and docstrings.