Skip to main content
Glama
wowjinxy
by wowjinxy

ban_member

Remove a user from a Discord server to enforce moderation policies. Specify user ID, optional server ID, message deletion timeframe, and reason for the ban.

Instructions

Ban a user from the server.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
user_idYes
server_idNo
delete_message_secondsNo
reasonNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The handler function that executes the ban_member tool: fetches guild and user, bans the user with optional reason and message deletion, returns confirmation message.
    async def handle_ban_member(discord_client, arguments: Dict[str, Any]) -> List[TextContent]:
        """Ban a member from the server"""
        guild = await discord_client.fetch_guild(int(arguments["server_id"]))
        user = await discord_client.fetch_user(int(arguments["user_id"]))
        
        kwargs = {
            "reason": arguments.get("reason", "Banned via MCP")
        }
        
        if "delete_message_days" in arguments:
            kwargs["delete_message_days"] = min(arguments["delete_message_days"], 7)
        elif "delete_message_seconds" in arguments:
            kwargs["delete_message_seconds"] = arguments["delete_message_seconds"]
        
        await guild.ban(user, **kwargs)
        
        return [TextContent(
            type="text",
            text=f"Banned user {user.name} from {guild.name}\nReason: {kwargs['reason']}"
        )]
  • The Tool definition including name, description, and inputSchema for the ban_member tool, which registers it with the MCP server.
        name="ban_member",
        description="Ban a member from the server with options",
        inputSchema={
            "type": "object",
            "properties": {
                "server_id": {"type": "string", "description": "Server ID"},
                "user_id": {"type": "string", "description": "User ID to ban"},
                "reason": {"type": "string", "description": "Reason for ban"},
                "delete_message_days": {"type": "number", "description": "Days of messages to delete (0-7)"},
                "delete_message_seconds": {"type": "number", "description": "Seconds of messages to delete"}
            },
            "required": ["server_id", "user_id"]
        }
    ),
  • The dispatch logic in call_tool that registers and routes 'ban_member' calls to AdvancedToolHandlers.handle_ban_member.
    advanced_tool_names = [
        "edit_server_settings", "create_server_template", "create_channel_category",
        "create_voice_channel", "create_stage_channel", "create_forum_channel",
        "create_announcement_channel", "edit_channel", "set_channel_permissions",
        "create_role", "edit_role", "delete_role", "create_role_hierarchy",
        "create_emoji", "create_webhook", "send_webhook_message",
        "ban_member", "kick_member", "timeout_member", "bulk_delete_messages",
        "create_scheduled_event", "create_invite", "create_thread", "create_automod_rule"
    ]
    
    if name in advanced_tool_names:
        handler_method = f"handle_{name}"
        if hasattr(AdvancedToolHandlers, handler_method):
            return await getattr(AdvancedToolHandlers, handler_method)(discord_client, arguments)
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. While 'Ban' implies a destructive, permanent action, the description doesn't specify whether this requires admin permissions, whether it's reversible (though 'unban_member' exists), what happens to the user's messages, or any rate limits. It mentions the server context but lacks critical operational details.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that front-loads the core action. There's no wasted verbiage or redundancy, making it easy to parse quickly while conveying the essential purpose.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a destructive administrative tool with 4 parameters (0% schema coverage) and no annotations, the description is severely incomplete. While an output schema exists (reducing need to describe returns), it doesn't address permissions, consequences, parameter meanings, or differentiation from similar tools. The context demands more comprehensive guidance.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate but provides no parameter information. It doesn't explain what 'user_id' or 'server_id' represent, what 'delete_message_seconds' controls, or how 'reason' is used. With 4 parameters (1 required) completely undocumented, the description fails to add meaningful semantic context.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb ('Ban') and resource ('a user from the server'), making the purpose immediately understandable. It distinguishes this from sibling tools like 'kick_member' or 'timeout_member' by specifying a ban action. However, it doesn't explicitly differentiate from 'unban_member' in terms of directionality.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives like 'kick_member', 'timeout_member', or 'unban_member'. It doesn't mention prerequisites (e.g., required permissions), consequences, or typical use cases, leaving the agent with no contextual usage information.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/wowjinxy/mcp-discord'

If you have feedback or need assistance with the MCP directory API, please join our Discord server