54 lines
1.6 KiB
C#
54 lines
1.6 KiB
C#
|
|
using System.Collections.Generic;
|
||
|
|
|
||
|
|
namespace MCPForUnity.Editor.Services
|
||
|
|
{
|
||
|
|
/// <summary>
|
||
|
|
/// Metadata for a discovered tool
|
||
|
|
/// </summary>
|
||
|
|
public class ToolMetadata
|
||
|
|
{
|
||
|
|
public string Name { get; set; }
|
||
|
|
public string Description { get; set; }
|
||
|
|
public bool StructuredOutput { get; set; }
|
||
|
|
public List<ParameterMetadata> Parameters { get; set; }
|
||
|
|
public string ClassName { get; set; }
|
||
|
|
public string Namespace { get; set; }
|
||
|
|
public bool AutoRegister { get; set; } = true;
|
||
|
|
public bool RequiresPolling { get; set; } = false;
|
||
|
|
public string PollAction { get; set; } = "status";
|
||
|
|
}
|
||
|
|
|
||
|
|
/// <summary>
|
||
|
|
/// Metadata for a tool parameter
|
||
|
|
/// </summary>
|
||
|
|
public class ParameterMetadata
|
||
|
|
{
|
||
|
|
public string Name { get; set; }
|
||
|
|
public string Description { get; set; }
|
||
|
|
public string Type { get; set; } // "string", "int", "bool", "float", etc.
|
||
|
|
public bool Required { get; set; }
|
||
|
|
public string DefaultValue { get; set; }
|
||
|
|
}
|
||
|
|
|
||
|
|
/// <summary>
|
||
|
|
/// Service for discovering MCP tools via reflection
|
||
|
|
/// </summary>
|
||
|
|
public interface IToolDiscoveryService
|
||
|
|
{
|
||
|
|
/// <summary>
|
||
|
|
/// Discovers all tools marked with [McpForUnityTool]
|
||
|
|
/// </summary>
|
||
|
|
List<ToolMetadata> DiscoverAllTools();
|
||
|
|
|
||
|
|
/// <summary>
|
||
|
|
/// Gets metadata for a specific tool
|
||
|
|
/// </summary>
|
||
|
|
ToolMetadata GetToolMetadata(string toolName);
|
||
|
|
|
||
|
|
/// <summary>
|
||
|
|
/// Invalidates the tool discovery cache
|
||
|
|
/// </summary>
|
||
|
|
void InvalidateCache();
|
||
|
|
}
|
||
|
|
}
|