diff --git a/astrbot/dashboard/routes/tools.py b/astrbot/dashboard/routes/tools.py
index 64cd78caa..d7b082000 100644
--- a/astrbot/dashboard/routes/tools.py
+++ b/astrbot/dashboard/routes/tools.py
@@ -3,6 +3,7 @@ import traceback
from quart import request
from astrbot.core import logger
+from astrbot.core.agent.mcp_client import MCPTool
from astrbot.core.core_lifecycle import AstrBotCoreLifecycle
from astrbot.core.star import star_map
@@ -296,15 +297,30 @@ class ToolsRoute(Route):
"""获取所有注册的工具列表"""
try:
tools = self.tool_mgr.func_list
- tools_dict = [
- {
+ tools_dict = []
+ for tool in tools:
+ if isinstance(tool, MCPTool):
+ origin = "mcp"
+ origin_name = tool.mcp_server_name
+ elif tool.handler_module_path and star_map.get(
+ tool.handler_module_path
+ ):
+ star = star_map[tool.handler_module_path]
+ origin = "plugin"
+ origin_name = star.name
+ else:
+ origin = "unknown"
+ origin_name = "unknown"
+
+ tool_info = {
"name": tool.name,
"description": tool.description,
"parameters": tool.parameters,
"active": tool.active,
+ "origin": origin,
+ "origin_name": origin_name,
}
- for tool in tools
- ]
+ tools_dict.append(tool_info)
return Response().ok(data=tools_dict).__dict__
except Exception as e:
logger.error(traceback.format_exc())
diff --git a/dashboard/src/views/ToolUsePage.vue b/dashboard/src/components/extension/McpServersSection.vue
similarity index 62%
rename from dashboard/src/views/ToolUsePage.vue
rename to dashboard/src/components/extension/McpServersSection.vue
index db8fee905..fe20497f8 100644
--- a/dashboard/src/views/ToolUsePage.vue
+++ b/dashboard/src/components/extension/McpServersSection.vue
@@ -4,42 +4,18 @@
- {{ tm('subtitle') }}
-
-
-
{{ tm('mcpServers.empty') }}
@@ -57,7 +33,6 @@{{ tm('functionTools.empty') }}
-
-
{{ tool.description }}
- - -
-
{{ tm('functionTools.noParameters') }}
-