"""
Template for creating new FastMCP modules

This template shows the standard structure for implementing MCP tools
using FastMCP framework. Copy this file and modify it for your service.

Example usage:
1. Copy this file to products/mcp/yourservice.py
2. Replace 'template' with your service name throughout
3. Implement your service client and tools
4. Add imports to __init__.py
5. Update mcp_server.py to use your module (if needed)
"""

import logging
from fastmcp import FastMCP

logger = logging.getLogger(__name__)

# Initialize your service client here
# example_client = YourServiceClient()

# Create FastMCP instance for your service
template_mcp = FastMCP("CQA Template MCP Server")

@template_mcp.tool
def template_example_tool(param1: str, param2: str = "default"):
    """Example tool for template service
    
    Args:
        param1: Required parameter
        param2: Optional parameter with default value
    """
    logger.info(f"Executing template_example_tool with param1={param1}, param2={param2}")
    
    # Implement your tool logic here
    # result = your_service_client.do_something(param1, param2)
    
    return {
        "message": f"Template tool executed with param1={param1}, param2={param2}",
        "status": "success"
    }

@template_mcp.tool
def template_list_items():
    """List items from your service"""
    logger.info("Executing template_list_items")
    
    # Implement your service call here
    # return your_service_client.list_items()
    
    return {
        "items": ["item1", "item2", "item3"],
        "count": 3
    }

def get_template_mcp_server():
    """Get the configured Template MCP server instance"""
    return template_mcp

def get_mcp_info():
    """Get MCP server information"""
    return {
        "server_name": "cqa-template-mcp",
        "server_version": "1.0.0",
        "service_connected": True  # Replace with actual service connection check
    }
