Skip to main content
Glama
hanweg

mcp-discord

by hanweg

moderate_message

Delete specific Discord messages and optionally apply timeouts to users, ensuring moderation compliance and maintaining server standards.

Instructions

Delete a message and optionally timeout the user

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
channel_idYesChannel ID containing the message
message_idYesID of message to moderate
reasonYesReason for moderation
timeout_minutesNoOptional timeout duration in minutes

Implementation Reference

  • Handler that fetches the message, deletes it with the given reason, and optionally times out the message author for the specified number of minutes.
    elif name == "moderate_message":
        channel = await discord_client.fetch_channel(int(arguments["channel_id"]))
        message = await channel.fetch_message(int(arguments["message_id"]))
        
        # Delete the message
        await message.delete(reason=arguments["reason"])
        
        # Handle timeout if specified
        if "timeout_minutes" in arguments and arguments["timeout_minutes"] > 0:
            if isinstance(message.author, discord.Member):
                duration = discord.utils.utcnow() + datetime.timedelta(
                    minutes=arguments["timeout_minutes"]
                )
                await message.author.timeout(
                    duration,
                    reason=arguments["reason"]
                )
                return [TextContent(
                    type="text",
                    text=f"Message deleted and user timed out for {arguments['timeout_minutes']} minutes."
                )]
        
        return [TextContent(
            type="text",
            text="Message deleted successfully."
        )]
  • Registers the 'moderate_message' tool in the list_tools() handler, including its description and input schema definition.
    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  # Max 4 weeks
                }
            },
            "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 the full burden of behavioral disclosure. It mentions deletion and optional timeout but lacks critical details: whether this action is reversible, what permissions are required, if there are rate limits, or what happens to the user during timeout. For a mutation tool with zero annotation coverage, this is a significant gap.

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 with zero waste—it directly states the core action and optional feature. Every word earns its place, making it highly concise and well-structured.

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?

Given the tool's complexity (a mutation with no annotations and no output schema), the description is insufficient. It does not cover behavioral aspects like permissions, reversibility, or response format, nor does it explain the optional timeout's effects. For a moderation tool, this leaves critical gaps in understanding.

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

Parameters3/5

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

Schema description coverage is 100%, so the schema already documents all four parameters (channel_id, message_id, reason, timeout_minutes) with their types and constraints. The description adds no additional meaning beyond what the schema provides, such as explaining the 'reason' parameter's format or the implications of 'timeout_minutes'. Baseline 3 is appropriate when the schema does the heavy lifting.

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 ('Delete a message') and optional additional action ('optionally timeout the user'), which distinguishes it from sibling tools like 'delete_channel' (which deletes channels) or 'remove_role' (which removes roles). The verb+resource combination is precise and unambiguous.

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 'delete_channel' or 'remove_role', nor does it mention prerequisites (e.g., moderation permissions) or exclusions. It merely states what the tool does without 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

Related 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/hanweg/mcp-discord'

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