Skip to content

Commit aa3ce83

Browse files
committed
fix: conditionally validate MCP transport code in tool.py
1 parent 6c156af commit aa3ce83

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

apps/tools/serializers/tool.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1120,7 +1120,8 @@ def import_(self, scope=ToolScope.WORKSPACE, name=None, source=None):
11201120
is_active=False,
11211121
)
11221122
# 校验代码是否包括禁止的关键字
1123-
ToolExecutor().validate_mcp_transport(code)
1123+
if tool.get("tool_type") == ToolType.MCP:
1124+
ToolExecutor().validate_mcp_transport(code)
11241125
tool_model.save()
11251126
if tool.get("tool_type") == ToolType.WORKFLOW:
11261127
tool["id"] = tool_id

0 commit comments

Comments
 (0)