Source code for tools.current_time

"""Returns the current UTC date and time."""

from datetime import datetime, timezone

TOOL_NAME = "current_time"
TOOL_DESCRIPTION = "Returns the current date and time in UTC."
TOOL_PARAMETERS = {
    "type": "object",
    "properties": {},
}


[docs] async def run() -> str: """Execute this tool and return the result. Returns: str: Result string. """ now = datetime.now(timezone.utc) return now.strftime("%Y-%m-%d %H:%M:%S UTC")