diff --git a/src/Infrastructure/BotSharp.Abstraction/Agents/Models/MCPTool.cs b/src/Infrastructure/BotSharp.Abstraction/Agents/Models/MCPTool.cs index a555a7e5..4ffd4915 100644 --- a/src/Infrastructure/BotSharp.Abstraction/Agents/Models/MCPTool.cs +++ b/src/Infrastructure/BotSharp.Abstraction/Agents/Models/MCPTool.cs @@ -2,10 +2,9 @@ namespace BotSharp.Abstraction.Agents.Models; public class MCPTool { + public string Name { get; set; } public string ServerId { get; set; } - public bool Disabled { get; set; } - public IEnumerable Functions { get; set; } = []; public MCPTool() @@ -14,8 +13,14 @@ public class MCPTool } public MCPTool( + string name, + string serverId, + bool disabled = false, IEnumerable? functions = null) { + Name = name; + ServerId = serverId; + Disabled = disabled; Functions = functions ?? []; } @@ -32,6 +37,6 @@ public class MCPFunction public MCPFunction(string name) { - this.Name = name; + Name = name; } } diff --git a/src/Plugins/BotSharp.Plugin.MongoStorage/Models/AgentMCPToolMongoElement.cs b/src/Plugins/BotSharp.Plugin.MongoStorage/Models/AgentMCPToolMongoElement.cs index c913cd1d..a14e2fad 100644 --- a/src/Plugins/BotSharp.Plugin.MongoStorage/Models/AgentMCPToolMongoElement.cs +++ b/src/Plugins/BotSharp.Plugin.MongoStorage/Models/AgentMCPToolMongoElement.cs @@ -10,21 +10,25 @@ public class AgentMCPToolMongoElement public bool Disabled { get; set; } public List Functions { get; set; } = []; - public static AgentMCPToolMongoElement ToMongoElement(MCPTool utility) + public static AgentMCPToolMongoElement ToMongoElement(MCPTool tool) { return new AgentMCPToolMongoElement { - Disabled = utility.Disabled, - Functions = utility.Functions?.Select(x => new McpFunctionMongoElement(x.Name))?.ToList() ?? [], + Name = tool.Name, + ServerId = tool.ServerId, + Disabled = tool.Disabled, + Functions = tool.Functions?.Select(x => new McpFunctionMongoElement(x.Name))?.ToList() ?? [], }; } - public static MCPTool ToDomainElement(AgentMCPToolMongoElement utility) + public static MCPTool ToDomainElement(AgentMCPToolMongoElement tool) { return new MCPTool { - Disabled = utility.Disabled, - Functions = utility.Functions?.Select(x => new MCPFunction(x.Name))?.ToList() ?? [], + Name = tool.Name, + ServerId = tool.ServerId, + Disabled = tool.Disabled, + Functions = tool.Functions?.Select(x => new MCPFunction(x.Name))?.ToList() ?? [], }; } }