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

using ModelContextProtocol.Server;
using System.ComponentModel;

namespace ColaFlow.API.Mcp.Sdk;

/// <summary>
/// PoC class to test Microsoft MCP SDK Resource registration
/// NOTE: McpServerResource attribute MUST be on methods, not properties
/// </summary>
[McpServerResourceType]
public class SdkPocResources
{
    /// <summary>
    /// Simple resource method to test SDK attribute system
    /// </summary>
    [McpServerResource]
    [Description("Check MCP SDK integration status")]
    public static Task<string> GetSdkStatus()
    {
        return Task.FromResult("""
            {
                "status": "active",
                "sdk": "Microsoft.ModelContextProtocol",
                "version": "0.4.0-preview.3",
                "message": "SDK integration working!"
            }
            """);
    }

    /// <summary>
    /// Resource method to test health check
    /// </summary>
    [McpServerResource]
    [Description("Health check resource")]
    public static Task<string> GetHealthCheck()
    {
        var healthData = new
        {
            healthy = true,
            timestamp = DateTime.UtcNow,
            components = new[]
            {
                new { name = "MCP SDK", status = "operational" },
                new { name = "Attribute Discovery", status = "operational" },
                new { name = "DI Integration", status = "testing" }
            }
        };

        return Task.FromResult(System.Text.Json.JsonSerializer.Serialize(healthData));
    }
}
