Skip to main content
Glama
wowjinxy
by wowjinxy

moderate_message

Delete Discord messages and optionally timeout users to enforce server rules and maintain community standards.

Instructions

Moderate a message by deleting it and optionally timing out the author.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
channel_idYes
message_idYes
delete_messageNo
timeout_minutesNo
reasonNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The core handler function `handle_moderate_message` that implements the moderation logic: fetches the channel and message, deletes the message with a reason, optionally applies a timeout to the author if they are a member, and returns a formatted confirmation message.
    @staticmethod
    async def handle_moderate_message(discord_client, arguments: Dict[str, Any]) -> List[TextContent]:
        """Delete a message and optionally timeout the user"""
        channel = await discord_client.fetch_channel(int(arguments["channel_id"]))
        message = await channel.fetch_message(int(arguments["message_id"]))
        
        # Get the message author before deletion
        author = message.author
        content_preview = message.content[:50] + "..." if len(message.content) > 50 else message.content
        
        # Delete the message
        await message.delete(reason=arguments["reason"])
        
        result = f"Deleted message from {author.name}: '{content_preview}'\nReason: {arguments['reason']}"
        
        # Apply timeout if specified
        if "timeout_minutes" in arguments and arguments["timeout_minutes"] > 0:
            if isinstance(author, discord.Member):
                timeout_duration = timedelta(minutes=arguments["timeout_minutes"])
                await author.timeout(timeout_duration, reason=arguments["reason"])
                result += f"\nApplied {arguments['timeout_minutes']} minute timeout to {author.name}"
            else:
                result += f"\nCould not timeout {author.name} (user may not be in server)"
        
        return [TextContent(type="text", text=result)]
  • The MCP Tool registration for 'moderate_message', including name, description, and input schema defining parameters: channel_id (required string), message_id (required string), reason (required string), timeout_minutes (optional number 0-40320).
    Tool(
        name="moderate_message",
        description="Delete a message and optionally timeout the user",
        inputSchema={
            "type": "object",
            "properties": {
                "channel_id": {
                    "type": "string",
                    "description": "Channel ID containing the message"
                },
                "message_id": {
                    "type": "string",
                    "description": "ID of message to moderate"
                },
                "reason": {
                    "type": "string",
                    "description": "Reason for moderation"
                },
                "timeout_minutes": {
                    "type": "number",
                    "description": "Optional timeout duration in minutes",
                    "minimum": 0,
                    "maximum": 40320
                }
            },
            "required": ["channel_id", "message_id", "reason"]
        }
    ),
  • The input schema for the moderate_message tool, specifying the required and optional parameters with types and descriptions.
        inputSchema={
            "type": "object",
            "properties": {
                "channel_id": {
                    "type": "string",
                    "description": "Channel ID containing the message"
                },
                "message_id": {
                    "type": "string",
                    "description": "ID of message to moderate"
                },
                "reason": {
                    "type": "string",
                    "description": "Reason for moderation"
                },
                "timeout_minutes": {
                    "type": "number",
                    "description": "Optional timeout duration in minutes",
                    "minimum": 0,
                    "maximum": 40320
                }
            },
            "required": ["channel_id", "message_id", "reason"]
        }
    ),
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 mentions the destructive actions (deletion and timeout) but doesn't specify whether these are reversible, what permissions are needed, rate limits, error conditions, or what happens when timeout_minutes is null. For a mutation tool with significant impact, this leaves critical behavioral aspects undocumented.

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 communicates the core functionality without unnecessary words. It's front-loaded with the primary action and includes the optional secondary action. Every word serves a purpose in conveying 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 moderation tool with 5 parameters, 0% schema coverage, no annotations, and multiple sibling alternatives, the description is inadequate. While an output schema exists (which reduces the need to describe return values), the description doesn't address critical context like required permissions, irreversible consequences, or when to choose this over similar tools. The presence of an output schema doesn't compensate for these 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 5 parameters, the description provides no parameter-specific information beyond what's implied by the tool name. It mentions 'optionally timing out the author' which hints at the timeout_minutes parameter, but doesn't explain channel_id, message_id, delete_message (default behavior), or reason parameters. The description fails to compensate for the complete lack of schema descriptions.

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

Purpose5/5

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

The description clearly states the specific action ('moderate a message by deleting it and optionally timing out the author'), identifying both the primary verb ('moderate') and the resources involved (message, author). It distinguishes itself from sibling tools like 'delete_channel', 'bulk_delete_messages', and 'timeout_member' by focusing on message-level moderation with optional author timeout.

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 'bulk_delete_messages' for multiple messages or 'timeout_member' for timeout without deletion. It doesn't mention prerequisites, permissions required, or contextual factors that should influence tool selection.

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