from abc import ABC, abstractmethod
from typing import Any, Dict

class Tool(ABC):
    """Base class for all tools that can be used by agents"""
    
    def __init__(self, name: str, description: str):
        self.name = name
        self.description = description
        
    @abstractmethod
    async def execute(self, input_data: Any) -> Dict[str, Any]:
        """Execute the tool's functionality"""
        pass
    
    def validate_input(self, input_data: Any) -> bool:
        """Validate the input data before execution"""
        return True
    
    def format_output(self, output: Any) -> Dict[str, Any]:
        """Format the output data after execution"""
        return {"result": output}
