diff --git a/lib/galaxy/tool_util/toolbox/base.py b/lib/galaxy/tool_util/toolbox/base.py
index f70d2978b4f2..a0a0e92918ca 100644
--- a/lib/galaxy/tool_util/toolbox/base.py
+++ b/lib/galaxy/tool_util/toolbox/base.py
@@ -408,6 +408,12 @@ def load_item(
panel_dict = self._tool_panel
if integrated_panel_dict is None:
integrated_panel_dict = self._integrated_tool_panel
+ load_if = item.get("if")
+ if load_if == "interactivetools_enable":
+ if not self.app.config.interactivetools_enable:
+ raise ValueError("Trying to load an InteractiveTool, but InteractiveTools are not enabled.")
+ elif load_if:
+ raise ValueError(f"Unknown conditional tool load condition '{load_if}'")
if item_type == "tool":
self._load_tool_tag_set(
item,
diff --git a/test/functional/tools/sample_tool_conf.xml b/test/functional/tools/sample_tool_conf.xml
index 8775d130e520..1075c1219e93 100644
--- a/test/functional/tools/sample_tool_conf.xml
+++ b/test/functional/tools/sample_tool_conf.xml
@@ -237,8 +237,8 @@
-
-
+
+