diff --git a/src/Infrastructure/BotSharp.Abstraction/Agents/Models/MCPTool.cs b/src/Infrastructure/BotSharp.Abstraction/Agents/Models/MCPTool.cs index fc8fbb62..a555a7e5 100644 --- a/src/Infrastructure/BotSharp.Abstraction/Agents/Models/MCPTool.cs +++ b/src/Infrastructure/BotSharp.Abstraction/Agents/Models/MCPTool.cs @@ -2,8 +2,6 @@ namespace BotSharp.Abstraction.Agents.Models; public class MCPTool { - public string Name { get; set; } - public string ServerId { get; set; } public bool Disabled { get; set; } @@ -16,16 +14,14 @@ public class MCPTool } public MCPTool( - string name, IEnumerable? functions = null) { - Name = name; Functions = functions ?? []; } public override string ToString() { - return Name; + return ServerId; } } @@ -34,8 +30,8 @@ public class MCPFunction { public string Name { get; set; } - public MCPFunction() + public MCPFunction(string name) { - + this.Name = name; } } diff --git a/src/Infrastructure/BotSharp.MCP/Functions/McpToolFunction.cs b/src/Infrastructure/BotSharp.MCP/Functions/McpToolFunction.cs index 5df8fb07..a89cc10c 100644 --- a/src/Infrastructure/BotSharp.MCP/Functions/McpToolFunction.cs +++ b/src/Infrastructure/BotSharp.MCP/Functions/McpToolFunction.cs @@ -47,7 +47,6 @@ public class McpToolFunction : IFunctionCallback if (string.IsNullOrEmpty(json)) return []; - // 使用JsonDocument解析JSON字符串 using JsonDocument doc = JsonDocument.Parse(json); JsonElement root = doc.RootElement; return JsonElementToDictionary(root); diff --git a/src/Plugins/BotSharp.Plugin.MongoStorage/Models/AgentMCPToolMongoElement.cs b/src/Plugins/BotSharp.Plugin.MongoStorage/Models/AgentMCPToolMongoElement.cs index dae4c665..ecad71f3 100644 --- a/src/Plugins/BotSharp.Plugin.MongoStorage/Models/AgentMCPToolMongoElement.cs +++ b/src/Plugins/BotSharp.Plugin.MongoStorage/Models/AgentMCPToolMongoElement.cs @@ -22,10 +22,8 @@ public class AgentMCPToolMongoElement { return new AgentMCPToolMongoElement { - Name = utility.Name, Disabled = utility.Disabled, Functions = utility.Functions?.Select(x => new McpFunctionMongoElement(x.Name))?.ToList() ?? [], - Templates = utility.Templates?.Select(x => new McpTemplateMongoElement(x.Name))?.ToList() ?? [] }; } @@ -33,10 +31,8 @@ public class AgentMCPToolMongoElement { return new MCPTool { - Name = utility.Name, Disabled = utility.Disabled, Functions = utility.Functions?.Select(x => new MCPFunction(x.Name))?.ToList() ?? [], - Templates = utility.Templates?.Select(x => new ACPTemplate(x.Name))?.ToList() ?? [] }; } }