""" PydanticAI toolset for Tatlock's core tools. Converts the core tool functions into PydanticAI tool definitions that can be registered with agents and the household registry. """ from pydantic_ai.tools import Tool from . import tools # Create tool definitions for PydanticAI calculator_tool = Tool( function=tools.calculate, name="calculate", description=( "Safely evaluate mathematical expressions. " "Supports basic arithmetic (+, -, *, /, %, **), " "functions (sqrt, sin, cos, log, exp, etc.), " "and constants (pi, e). " "Use this for ALL mathematical calculations." ), ) current_datetime_tool = Tool( function=tools.get_current_datetime, name="get_current_datetime", description=( "Get the current date and time. " "Supports various formats: 'full' (datetime), 'date' (YYYY-MM-DD), " "'time' (HH:MM:SS), 'iso' (ISO 8601), or custom strftime format. " "Use this instead of guessing the current date/time." ), ) time_offset_tool = Tool( function=tools.calculate_time_offset, name="calculate_time_offset", description=( "Calculate a date/time relative to now. " "Accepts natural language like '1 week ago', '2 days from now', " "'3 months ago', etc. " "Use this for calculating past or future dates." ), ) time_difference_tool = Tool( function=tools.time_difference, name="time_difference", description=( "Calculate the difference between two dates. " "Accepts dates in YYYY-MM-DD or YYYY-MM-DD HH:MM:SS format. " "Second date can be 'now'. " "Returns human-readable difference (e.g., '5 days, 3 hours')." ), ) # NOTE: Web search has been moved to The Librarian agent. # Use delegate_to_librarian(task="search web for ...") for web search. # Combined toolset of all core tools tatlock_core_tools = [ calculator_tool, current_datetime_tool, time_offset_tool, time_difference_tool, ] def get_core_tools(): """ Get list of Tatlock's core tool definitions. Returns: List of PydanticAI Tool objects """ return tatlock_core_tools