eigent/backend/app/controller/tool_controller.py
wol 03f2c49b7e
Some checks failed
Remove old artifacts / remove-old-artifacts (push) Has been cancelled
init
2025-08-04 00:20:29 +08:00

19 lines
492 B
Python

from fastapi import APIRouter
from app.utils.toolkit.notion_mcp_toolkit import NotionMCPToolkit
router = APIRouter(tags=["task"])
@router.post("/install/tool/{tool}", name="install tool")
async def install_tool(tool: str):
if tool == "notion":
toolkit = NotionMCPToolkit(tool)
await toolkit.connect()
else:
return {"error": "Tool not found"}
tools = [tool.func.__name__ for tool in toolkit.get_tools()]
await toolkit.disconnect()
return tools