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

Function main

backend/update_schema.py:7–38  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

5from app.models.plugin_tool import PluginTool
6
7async def main():
8 async with async_session() as db:
9 res = await db.execute(select(PluginTool).where(PluginTool.name == 'agentbay_computer_screenshot'))
10 tool = res.scalar_one_or_none()
11 if not tool:
12 print("Tool not found")
13 return
14
15 print("Old schema:", tool.schema)
16
17 new_schema = {
18 "type": "function",
19 "function": {
20 "name": "agentbay_computer_screenshot",
21 "description": "Take a screenshot of the CURRENT Windows desktop cloud computer screen. Use this to verify the result of a click, type, or to read information off the screen.",
22 "parameters": {
23 "type": "object",
24 "properties": {
25 "save_to_workspace": {
26 "type": "boolean",
27 "description": "CRITICAL: Set to True IF AND ONLY IF the user explicitly asked you to SHOW them a screenshot or save it (e.g. \"截图给我看\", \"发截图\", \"保存桌面截图\"). If True, the image is saved to their workspace and you get a Markdown link. Default is False (internal in-memory analysis only, completely invisible to the user).",
28 "default": False
29 }
30 }
31 }
32 }
33 }
34
35 tool.schema = new_schema
36 tool.description = new_schema["function"]["description"]
37 await db.commit()
38 print("Updated schema successfully.")
39
40if __name__ == "__main__":
41 asyncio.run(main())

Callers 1

update_schema.pyFile · 0.70

Calls 4

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

Tested by

no test coverage detected