namespace McpStudy.McpServerSSE.Tools { [McpServerToolType] public class StringTools { [McpServerTool,DisplayName("GetTextLength"), Description("获取文本的长度")] public static int GetTextLength(string text) { if (text == null) { return 0; } return text.Length; } [McpServerTool, DisplayName("ReverseText"), Description("反转文本内容:把给定文本反序")] public static string ReverseText(string text) { if (text == null) { return ""; } else { return string.Join("", text.Reverse()); } } } }