From d790defcfe25c04a59cf984e4e4b21e81974bcca Mon Sep 17 00:00:00 2001 From: zengmq <2306188113@qq.com> Date: Sun, 8 Jun 2025 02:06:41 +0800 Subject: [PATCH] prompt --- host/McpServerList.cs | 74 ++++++++++++++++---------------- resource/prompt/SystemPrompt.txt | 3 +- 2 files changed, 39 insertions(+), 38 deletions(-) diff --git a/host/McpServerList.cs b/host/McpServerList.cs index 22eece2..8983cf9 100644 --- a/host/McpServerList.cs +++ b/host/McpServerList.cs @@ -35,18 +35,18 @@ public class McpServerList Description = "可以调用进行查询知识库,获取相关参考信息。有地理信息的相关案例步骤参考以及Arcgis Pro的工具详细信息", IsActive = true }); - servers.Add("filesystem", new StdioMcpServer() - { - Name = "filesystem", - Type = "stdio", - Command = "npx", - Args = new List() - { - "-y", - "@modelcontextprotocol/server-filesystem", - "F:\\secondsemester\\linktool\\test\\LinkTool0607\\LinkTool0607.gdb" - } - }); + //servers.Add("filesystem", new StdioMcpServer() + //{ + // Name = "filesystem", + // Type = "stdio", + // Command = "npx", + // Args = new List() + // { + // "-y", + // "@modelcontextprotocol/server-filesystem", + // "F:\\secondsemester\\linktool\\test\\LinkTool0607\\LinkTool0607.gdb" + // } + //}); //servers.Add("fetch", new StdioMcpServer() //{ // Name = "fetch", @@ -57,31 +57,31 @@ public class McpServerList // "mcp-server-fetch" // } //}); - servers.Add("bing-search", new StdioMcpServer() - { - Name = "bing-search", - Type = "stdio", - Command = "npx", - Args = new List() - { - "bing-cn-mcp" - } - }); - servers.Add("mcp-python-interpreter", new StdioMcpServer() - { - Name = "mcp-python-interpreter", - Type = "stdio", - Command = "uvx", - Args = new List() - { - "--native-tls", - "mcp-python-interpreter", - "--dir", - "F:\\secondsemester\\linktool\\test\\LinkTool0607\\LinkTool0607.gdb", - "--python-path", - "C:\\Program Files\\ArcGIS\\Pro\\bin\\Python\\envs\\custom\\python.exe" - } - }); + //servers.Add("bing-search", new StdioMcpServer() + //{ + // Name = "bing-search", + // Type = "stdio", + // Command = "npx", + // Args = new List() + // { + // "bing-cn-mcp" + // } + //}); + //servers.Add("mcp-python-interpreter", new StdioMcpServer() + //{ + // Name = "mcp-python-interpreter", + // Type = "stdio", + // Command = "uvx", + // Args = new List() + // { + // "--native-tls", + // "mcp-python-interpreter", + // "--dir", + // "F:\\secondsemester\\linktool\\test\\LinkTool0607\\LinkTool0607.gdb", + // "--python-path", + // "C:\\Program Files\\ArcGIS\\Pro\\bin\\Python\\envs\\custom\\python.exe" + // } + //}); } public McpServer GetServer(string name) diff --git a/resource/prompt/SystemPrompt.txt b/resource/prompt/SystemPrompt.txt index c09ec28..033807f 100644 --- a/resource/prompt/SystemPrompt.txt +++ b/resource/prompt/SystemPrompt.txt @@ -43,7 +43,8 @@ 你必须严格遵守以下每一条规则: 1.用户时间宝贵,一旦确认工具成功调用之后,不得重复调用上一次已成功执行的工具,除非有新的参数或上下文变化。 -2.调用“ArcGisPro:ArcGisProTool”工具前一定要先调用“plan{}”规划工具的使用,确认调用工具流程之后再调用知识库将规划的正确调用名、以及工具参数返回到tool_result中,最后再逐步执行工具。 +2.调用“ArcGisPro:ArcGisProTool”工具前一定要先调用知识库工具检查工具调用名和参数是否正确,name一定要严格按照知识库的调用名,例如analysis.Erase。如果有非必填的参数要用""空开 3.参数都应为字符串类型,可以表示文件或其他输出类型。 4.一旦消息中没有工具或提示词调用信息即视为任务完成。因此工具或提示词调用必须连续完成。 5.只响应用户目前的需求即可,不要过度猜测用户的需求,如果有下一步的工具建议只输出文本即可,如果输出XML会执行大量无用的工具。 +