MCPcopy
hub / github.com/dataelement/Clawith / run

Function run

backend/remove_old_tool.py:7–19  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

5from app.models.tool import Tool
6
7async def run():
8 async with async_session_maker() as session:
9 result = await session.execute(select(Tool).where(Tool.name == "generate_image"))
10 tool = result.scalar_one_or_none()
11 if tool:
12 await session.execute(
13 f"DELETE FROM agent_tools WHERE tool_id = '{tool.id}'"
14 )
15 await session.delete(tool)
16 await session.commit()
17 print("Successfully deleted old 'generate_image' tool and its references.")
18 else:
19 print("Tool 'generate_image' not found in database.")
20
21if __name__ == "__main__":
22 asyncio.run(run())

Callers 1

remove_old_tool.pyFile · 0.85

Calls 5

whereMethod · 0.80
executeMethod · 0.45
scalar_one_or_noneMethod · 0.45
deleteMethod · 0.45
commitMethod · 0.45

Tested by

no test coverage detected