Skip to main content
Glama
wowjinxy
by wowjinxy

bulk_delete_messages

Remove multiple recent messages from a Discord channel to manage content or perform moderation tasks.

Instructions

Delete multiple recent messages from a channel.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
channel_idYes
message_idsNo
limitNo
reasonNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The main handler function that executes the bulk delete messages tool. Fetches the channel, purges up to 100 recent messages, and returns a confirmation message.
    async def handle_bulk_delete_messages(discord_client, arguments: Dict[str, Any]) -> List[TextContent]:
        """Bulk delete messages in a channel"""
        channel = await discord_client.fetch_channel(int(arguments["channel_id"]))
        limit = min(arguments["limit"], 100)
        
        deleted = await channel.purge(
            limit=limit,
            reason=arguments.get("reason", "Bulk delete via MCP")
        )
        
        return [TextContent(
            type="text",
            text=f"Deleted {len(deleted)} messages from #{channel.name}\nReason: {arguments.get('reason', 'Bulk delete via MCP')}"
        )]
  • The JSON schema defining the input parameters for the bulk_delete_messages tool: channel_id (required), limit (required, max 100), reason (optional).
    inputSchema={
        "type": "object",
        "properties": {
            "channel_id": {"type": "string", "description": "Channel ID"},
            "limit": {"type": "number", "description": "Number of messages to delete (max 100)"},
            "reason": {"type": "string", "description": "Reason for deletion"}
        },
        "required": ["channel_id", "limit"]
    }
  • The dispatching logic in call_tool that routes 'bulk_delete_messages' to the corresponding handler method in AdvancedToolHandlers class.
    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)
  • The Tool object instantiation that registers the bulk_delete_messages tool with MCP framework, including name, description, and schema.
    Tool(
        name="bulk_delete_messages",
        description="Bulk delete messages in a channel",
        inputSchema={
            "type": "object",
            "properties": {
                "channel_id": {"type": "string", "description": "Channel ID"},
                "limit": {"type": "number", "description": "Number of messages to delete (max 100)"},
                "reason": {"type": "string", "description": "Reason for deletion"}
            },
            "required": ["channel_id", "limit"]
        }
    ),
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It states this is a destructive deletion operation but provides no information about permissions needed, whether deletions are permanent/reversible, rate limits, confirmation prompts, or what happens if some messages can't be deleted. The mention of 'recent messages' hints at temporal constraints but doesn't specify what 'recent' means.

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 extremely concise at just 7 words, front-loading the core purpose with zero wasted words. Every element ('Delete multiple recent messages from a channel') directly contributes to understanding the tool's function.

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 bulk operation with 4 parameters, 0% schema coverage, no annotations, and multiple sibling tools, the description is inadequate. While an output schema exists (which reduces need to describe return values), the description doesn't address critical context like permissions, constraints, error conditions, or how this differs from similar tools. The combination of destructive operation + poor parameter documentation creates significant gaps.

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?

With 0% schema description coverage for all 4 parameters, the description provides no parameter information beyond what's implied by the tool name. It doesn't explain what 'channel_id' refers to, what format 'message_ids' should be in, what 'limit' controls, or what 'reason' is used for. The description fails to compensate for the complete lack of schema documentation.

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 action ('Delete multiple recent messages') and resource ('from a channel'), providing a specific verb+resource combination. However, it doesn't explicitly differentiate from sibling tools like 'delete_channel' or 'moderate_message', which might also handle message deletion in different contexts.

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 minimal guidance with 'recent messages' suggesting temporal scope, but offers no explicit when-to-use vs. alternatives like 'moderate_message' or single-message deletion tools. There's no mention of prerequisites, permissions required, or when this bulk operation is preferred over individual deletions.

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