Skip to content

Commit 6326d7e

Browse files
authored
fix: add MCP tools to function tool set in _plugin_tool_fix (#5144)
1 parent a809a09 commit 6326d7e

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

astrbot/core/astr_main_agent.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
from astrbot.core.skills.skill_manager import SkillManager, build_skills_prompt
4646
from astrbot.core.star.context import Context
4747
from astrbot.core.star.star_handler import star_map
48+
from astrbot.core.provider.manager import llm_tools
4849
from astrbot.core.tools.cron_tools import (
4950
CREATE_CRON_JOB_TOOL,
5051
DELETE_CRON_JOB_TOOL,
@@ -769,6 +770,14 @@ def _plugin_tool_fix(event: AstrMessageEvent, req: ProviderRequest) -> None:
769770
if plugin.name in event.plugins_name or plugin.reserved:
770771
new_tool_set.add_tool(tool)
771772
req.func_tool = new_tool_set
773+
else:
774+
# mcp tools
775+
tool_set = req.func_tool
776+
if not tool_set:
777+
tool_set = ToolSet()
778+
for tool in llm_tools.func_list:
779+
if isinstance(tool, MCPTool):
780+
tool_set.add_tool(tool)
772781

773782

774783
async def _handle_webchat(

0 commit comments

Comments
 (0)