Skip to content

Commit b2209a2

Browse files
committed
mark mcp tools as not safe
Signed-off-by: Lukas Schaefer <[email protected]>
1 parent 5f2057f commit b2209a2

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

ex_app/lib/tools.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,11 @@ async def get_tools(nc: Nextcloud):
3939
print(f"Invoking {function_name} from {module_name}")
4040
imported_tools = await get_tools_from_import(nc)
4141
for tool in imported_tools:
42-
if not hasattr(tool, 'func') or not hasattr(tool.func, 'safe'):
43-
safe_tools.append(tool) # external tools cannot be decorated and should always be safe
42+
if not hasattr(tool, 'func'):
43+
safe_tools.append(tool)
4444
continue
45-
if not tool.func.safe:
46-
dangerous_tools.append(tool)
45+
if not hasattr(tool.func, 'safe') or not tool.func.safe:
46+
dangerous_tools.append(tool) # MCP tools cannot be decorated and should always be dangerous
4747
else:
4848
safe_tools.append(tool)
4949
else:

0 commit comments

Comments
 (0)