from typing import List, Optional
from google.adk.tools import ToolContext
from solace_agent_mesh.agent.tools.dynamic_tool import DynamicTool, DynamicToolProvider


class MyToolProvider(DynamicToolProvider):
    """A provider that generates multiple dynamic tools for testing."""

    def create_tools(self, tool_config: Optional[dict] = None) -> List[DynamicTool]:
        # Decorated tools are automatically included by the framework!
        # This method is for any additional custom tools you want to create.
        return []


@MyToolProvider.register_tool
async def get_provider_farewell(self, name: str, tool_context: ToolContext = None) -> dict:
    """Returns a farewell message generated by the provider."""
    return {"farewell": f"Goodbye, {name}!"}


@MyToolProvider.register_tool
async def combine_strings(
    self, first: str, second: str, tool_context: ToolContext = None
) -> dict:
    """Combines two strings into one."""
    return {"combined": f"{first}{second}"}
