// PoC file to test Microsoft ModelContextProtocol SDK
// This demonstrates the SDK's attribute-based tool registration

using ModelContextProtocol.Server;
using System.ComponentModel;

namespace ColaFlow.API.Mcp.Sdk;

/// <summary>
/// PoC class to test Microsoft MCP SDK Tool registration
/// </summary>
[McpServerToolType]
public class SdkPocTools
{
    /// <summary>
    /// Simple ping tool to test SDK attribute system
    /// </summary>
    [McpServerTool]
    [Description("Test tool that returns a pong message")]
    public static Task<string> Ping()
    {
        return Task.FromResult("Pong from Microsoft MCP SDK!");
    }

    /// <summary>
    /// Tool with parameters to test SDK parameter marshalling
    /// </summary>
    [McpServerTool]
    [Description("Get project information by ID")]
    public static Task<object> GetProjectInfo(
        [Description("Project ID")] Guid projectId,
        [Description("Include archived projects")] bool includeArchived = false)
    {
        return Task.FromResult<object>(new
        {
            projectId,
            name = "SDK PoC Project",
            status = "active",
            includeArchived,
            message = "This is a PoC response from Microsoft MCP SDK"
        });
    }

    /// <summary>
    /// Tool with dependency injection to test SDK DI integration
    /// </summary>
    [McpServerTool]
    [Description("Get server time to test dependency injection")]
    public static Task<object> GetServerTime(ILogger<SdkPocTools> logger)
    {
        logger.LogInformation("GetServerTime tool called via Microsoft MCP SDK");

        return Task.FromResult<object>(new
        {
            serverTime = DateTime.UtcNow,
            message = "Dependency injection works!",
            sdkVersion = "0.4.0-preview.3"
        });
    }
}
