MCPcopy Create free account
hub / github.com/Roy3838/Observer / admin_usage

Function admin_usage

api/tools_router.py:61–72  ·  view source on GitHub ↗

(Admin) Today's and this month's counters, straight from Redis. Pass user_id for one user (direct reads, no scan); omit it for everyone active today. emails=true labels users by email at the cost of one Auth0 lookup each. Requires a valid X-Admin-Key header.

(
    user_id: str | None = None,
    emails: bool = False,
    is_admin: bool = Depends(get_admin_access),
)

Source from the content-addressed store, hash-verified

59
60@tools_router.get("/admin/usage", tags=["Admin"], summary="Daily and monthly usage counters")
61async def admin_usage(
62 user_id: str | None = None,
63 emails: bool = False,
64 is_admin: bool = Depends(get_admin_access),
65):
66 """
67 (Admin) Today's and this month's counters, straight from Redis. Pass
68 user_id for one user (direct reads, no scan); omit it for everyone active
69 today. emails=true labels users by email at the cost of one Auth0 lookup
70 each. Requires a valid X-Admin-Key header.
71 """
72 return await get_usage(user_id=user_id, emails=emails)
73
74
75@tools_router.post("/tools/send-email", tags=["Tools"])

Callers

nothing calls this directly

Calls 1

get_usageFunction · 0.90

Tested by

no test coverage detected