INNER CODE UNIT · Python

get_discord_system_prompt

existence-master/Sentient · src/server/mcp_hub/discord/main.py:28

def get_discord_system_prompt() -> str:
    return prompts.discord_agent_system_prompt

async def _execute_tool(ctx: Context, method_name: str, *args, **kwargs) -> Dict[str, Any]:
    try:
        user_id = auth.get_user_id_from_context(ctx)
        creds = await auth.get_discord_creds(user_id)
        client = utils.DiscordApiClient(bot_token=creds['bot_token'])
        
        method_to_call = getattr(client, method_name)
        result = await method_to_call(*args, **kwargs)
        
        return {"status": "success", "result": result}
    except Exception as e:
        logger.error(f"Tool execution failed for method '{method_name}': {e}", exc_info=True)
        return {"status": "failure", "error": str(e)}

@mcp.tool

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…