Merge pull request #495 from SuanmoSuanyangTechnology/feature/agent-tool_xjn

fix(mcp)
This commit is contained in:
Ke Sun
2026-03-06 16:40:03 +08:00
committed by GitHub
4 changed files with 47 additions and 3 deletions

View File

@@ -97,6 +97,12 @@ async def create_tool(
):
"""创建工具"""
try:
# 将 MCP 来源字段合并进 config
if request.tool_type == ToolType.MCP:
for key in ("source_channel", "market_id", "market_config_id", "mcp_service_id"):
val = getattr(request, key, None)
if val is not None:
request.config[key] = val
tool_id = service.create_tool(
name=request.name,
tool_type=request.tool_type,