chore: add check for inactive tools in base_mcp_node.py

This commit is contained in:
CaptainB 2025-09-03 14:35:40 +08:00
parent d21518e7b7
commit fcd6b53bfc

View File

@ -24,6 +24,8 @@ class BaseMcpNode(IMcpNode):
tool = QuerySet(Tool).filter(id=mcp_tool_id).first()
if not tool:
raise ValueError(f"Tool with ID {mcp_tool_id} not found.")
if not tool.is_active:
raise ValueError(f"Tool with ID {mcp_tool_id} is inactive.")
servers = json.loads(tool.code)
params = json.loads(json.dumps(tool_params))
params = self.handle_variables(params)