using System.Collections.Generic; using System.ComponentModel; using System.Threading.Tasks; using LinkToolAddin.host.llm.entity; using LinkToolAddin.resource; using LinkToolAddin.server; using ModelContextProtocol.Server; using Newtonsoft.Json; namespace LinkToolAddin.client.tool; public class KnowledgeBase { [McpServerTool, Description("可以查询ArcGIS Pro的帮助文档获取关于地理处理工具使用参数的说明")] public static async Task QueryArcgisHelpDoc(string query) { DocDb docDb = new DocDb("sk-db177155677e438f832860e7f4da6afc", DocDb.KnowledgeBase.ArcGISProHelpDoc); KnowledgeResult knowledgeResult = await docDb.Retrieve(query); JsonRpcResultEntity result = new JsonRpcSuccessEntity() { Result = JsonConvert.SerializeObject(knowledgeResult.ChunkList), }; return result; } [McpServerTool, Description("查询ArcGIS Pro调用工具的标准调用名和参数要求知识库")] public static async Task QueryArcgisToolDoc(string query) { DocDb docDb = new DocDb("sk-db177155677e438f832860e7f4da6afc", DocDb.KnowledgeBase.ArcGISProToolDoc); KnowledgeResult knowledgeResult = await docDb.Retrieve(query); JsonRpcResultEntity result = new JsonRpcSuccessEntity() { Result = JsonConvert.SerializeObject(knowledgeResult.ChunkList), }; return result; } [McpServerTool, Description("查询使用ArcGIS Pro进行任务规划和解决实际问题的案例知识库")] public static async Task QueryArcgisExampleDoc(string query) { DocDb docDb = new DocDb("sk-db177155677e438f832860e7f4da6afc", DocDb.KnowledgeBase.ArcGISProApplicantExample); KnowledgeResult knowledgeResult = await docDb.Retrieve(query); JsonRpcResultEntity result = new JsonRpcSuccessEntity() { Result = JsonConvert.SerializeObject(knowledgeResult.ChunkList), }; return result; } }