fix(mcp): MCP tool binds the information of the tool marketplace

This commit is contained in:
Timebomb2018
2026-03-06 16:32:33 +08:00
parent bccbeaabe4
commit 391cd602a2
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,