(may 3, 2025)

LLMs are text-based and can only generate responses based on their training data. On their own, they can’t interact with the real world. For example, they can’t fetch live weather data or access the latest news.

To bridge this gap, we provide tools that extend the capabilities of the LLM beyond just answering questions.

Tools should complement the LLM's strengths by enabling real-world interactions.

🎯 A Tool Should Do One Thing Well

Each tool should be simple and focused — doing one clear task. Examples include:

Tool Description
Web Search Allows the Agent to retrieve latest information from the internet
Image Generation Generate images based on a prompt
Retrieval Retrieve some information from external sources
API Interface Interacts with external APIs, like Github, Google, or Spotify

🔑 A Tool Consists of 3 (+1 optional) Key Parts:

  1. Description
description = "Return the current weather for a given city."
  1. A Callable — actual function the agent will call
def get_weather(city: str) -> str:
    return f"The weather in {city} is sunny."
  1. Arguments with types — Inputs & their data types (e.g., city: str)

  2. (Optional) Output type — Helps agents interpret results, but not always required.

    Why optional? Because the agent mainly needs to know how to call the tool. Thus, input descriptions, types, and function signatures are critical; output typing is helpful but not mandatory.

Here’s a simple, complete tool definition:

def multiply(a: int, b: int) -> int:
    """Return the product of integers a and b."""
    return a * b