MCPcopy
hub / github.com/AstrBotDevs/AstrBot / toggle_dashboard_tool

Function toggle_dashboard_tool

astrbot/dashboard/api/tools.py:333–340  ·  view source on GitHub ↗
(
    request: Request,
    _username: str = Depends(require_dashboard_user),
    service: ToolsService = Depends(get_service),
)

Source from the content-addressed store, hash-verified

331
332@legacy_router.post("/tools/toggle-tool")
333async def toggle_dashboard_tool(
334 request: Request,
335 _username: str = Depends(require_dashboard_user),
336 service: ToolsService = Depends(get_service),
337):
338 body = await _json_or_empty(request)
339 tool_id = _required_text(body.get("name"), "name")
340 return await _toggle_tool(tool_id, bool(body.get("activate")), service)
341
342
343@legacy_router.post("/tools/permission")

Callers

nothing calls this directly

Calls 4

_toggle_toolFunction · 0.85
_json_or_emptyFunction · 0.70
_required_textFunction · 0.70
getMethod · 0.45

Tested by

no test coverage detected