Tools

Utilities

Small, exact tools for the things models get wrong when they do them in their head: today's date, arithmetic and units.

ToolWhat it does
current_timeReturns the current date and time, in UTC or any IANA timezone such as Asia/Kolkata.
calculateEvaluates a maths expression safely โ€” arithmetic, powers and functions such as sqrt, log, round, factorial.
convert_unitsConverts between units of length, mass, temperature, time, data size, speed, volume and area.

current_time

Returns the current date and time, in UTC or any IANA timezone such as Asia/Kolkata.

How an agent gets it. Declare it in the agent's tools: list.

Arguments

ArgumentTypeRequiredMeaning
timezonestringIANA timezone name (e.g. 'Europe/London'). Defaults to UTC.

calculate

Evaluates a maths expression safely โ€” arithmetic, powers and functions such as sqrt, log, round, factorial.

How an agent gets it. Declare it in the agent's tools: list.

Arguments

ArgumentTypeRequiredMeaning
expressionstringyese.g. '(1234*19)/7', 'sqrt(2)+log(100,10)', 'factorial(8)'.

convert_units

Converts between units of length, mass, temperature, time, data size, speed, volume and area.

How an agent gets it. Declare it in the agent's tools: list.

Arguments

ArgumentTypeRequiredMeaning
valuenumberyes
from_unitstringyese.g. 'km', 'C', 'GB', 'lb'.
to_unitstringyese.g. 'mi', 'F', 'MB', 'kg'.