A tool is just a function

A “tool” in an agent system is nothing more than a plain function with a name, some arguments, and a return value. Here’s the smallest possible one:

Try it — edit and run
Check your understanding
1/1

What makes a Python function usable as an agent tool?

Exercise · Graded

Write a function `add(a, b)` that returns the sum of `a` and `b`.