diff --git a/client/tool/ArcGisPro.cs b/client/tool/ArcGisPro.cs index dbc5ac1..6c1adcf 100644 --- a/client/tool/ArcGisPro.cs +++ b/client/tool/ArcGisPro.cs @@ -24,7 +24,7 @@ public class ArcGisPro [McpServerTool, Description("可以通过调用ArcGIS Pro的地理处理工具实现一些数据处理功能,传入参数必须严格遵循ArcGIS Pro调用工具的标准调用名和参数要求知识库。")] public static async Task ArcGisProTool(string toolName, List toolParams) { - IGPResult results = await Geoprocessing.ExecuteToolAsync(toolName, toolParams); + IGPResult results = await Geoprocessing.ExecuteToolAsync(toolName, toolParams,null,null,null,GPExecuteToolFlags.InheritGPOptions|GPExecuteToolFlags.GPThread); JsonRpcResultEntity jsonRpcResultEntity; if (results.IsFailed) { diff --git a/host/Gateway.cs b/host/Gateway.cs index 57d9845..8ce17fb 100644 --- a/host/Gateway.cs +++ b/host/Gateway.cs @@ -636,7 +636,8 @@ public class Gateway private static async Task GetToolInfos(McpServerList mcpServerList) { StringBuilder toolInfos = new StringBuilder(); - int i = 0; + int i = 0; + List failedMcp = new List(); foreach (McpServer mcpServer in mcpServerList.GetAllServers()) { i++; @@ -715,7 +716,7 @@ public class Gateway }catch (Exception e) { log.Error(e.Message); - MessageBox.Show(e.Message, $"第{i}MCP读取错误"); + failedMcp.Add(i); } } @@ -731,9 +732,9 @@ public class Gateway catch (Exception e) { log.Error(e.Message); - MessageBox.Show(e.Message, $"{userPrompt.Name}提示词读取错误"); } } + MessageBox.Show($"读取失败的MCP序号:{JsonConvert.SerializeObject(failedMcp)}","MCP读取错误"); return toolInfos.ToString(); }