tools.discord_user_tools module
Discord user API tools using per-user OAuth tokens.
Provides access to the user’s own Discord profile, guilds, and connected accounts using their personal OAuth token (not the bot’s token). Requires the user to have connected their Discord account via the OAuth flow.
- async tools.discord_user_tools.discord_user_profile(ctx=None)[source]
Fetch the user’s own Discord profile via their OAuth token.
- Parameters:
ctx (
ToolContext|None) – Tool execution context, used to resolve the user’s personal Discord OAuth token.- Return type:
- Returns:
JSON string with profile fields (id, username, email, avatar, Nitro/premium type, etc.), or an error/not-connected message.
- async tools.discord_user_tools.discord_user_guilds(limit=50, ctx=None)[source]
List Discord guilds the user belongs to via their OAuth token.
- Parameters:
limit (
int) – Maximum number of guilds to return (capped at 200).ctx (
ToolContext|None) – Tool execution context, used to resolve the user’s personal Discord OAuth token.
- Return type:
- Returns:
JSON string with a guild count and list (id, name, icon, owner, permissions, features), or an error/not-connected message.
- async tools.discord_user_tools.discord_user_connections(ctx=None)[source]
List the user’s connected accounts via their OAuth token.
- Parameters:
ctx (
ToolContext|None) – Tool execution context, used to resolve the user’s personal Discord OAuth token.- Return type:
- Returns:
JSON string with a count and list of connected accounts (type, name, id, verified, visibility), or an error/not-connected message.