Skip to main content
Glama
jar285

MCP-Discord

by jar285

discord_delete_message

Delete a specific message from a Discord text channel using channel and message IDs. This tool removes unwanted or incorrect messages to maintain channel organization.

Instructions

Deletes a specific message from a Discord text channel

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
channelIdYes
messageIdYes
reasonNo

Implementation Reference

  • The handler implementation for the discord_delete_message tool. It validates input with DeleteMessageSchema, checks client readiness, fetches the channel and message, deletes the message, and returns success or error response.
    case "discord_delete_message": {
      const { channelId, messageId, reason } = DeleteMessageSchema.parse(args);
      try {
        if (!client.isReady()) {
          return {
            content: [{ type: "text", text: "Discord client not logged in. Please use discord_login tool first." }],
            isError: true
          };
        }
    
        const channel = await client.channels.fetch(channelId);
        if (!channel || !channel.isTextBased() || !('messages' in channel)) {
          return {
            content: [{ type: "text", text: `Cannot find text channel with ID: ${channelId}` }],
            isError: true
          };
        }
    
        // Fetch the message
        const message = await channel.messages.fetch(messageId);
        if (!message) {
          return {
            content: [{ type: "text", text: `Cannot find message with ID: ${messageId}` }],
            isError: true
          };
        }
    
        // Delete the message
        await message.delete();
    
        return {
          content: [{ 
            type: "text", 
            text: `Successfully deleted message with ID: ${messageId} from channel: ${channelId}` 
          }]
        };
      } catch (error) {
        return {
          content: [{ type: "text", text: `Failed to delete message: ${error}` }],
          isError: true
        };
      }
    }
  • Zod schema defining the input parameters for the discord_delete_message tool: channelId, messageId, and optional reason.
    const DeleteMessageSchema = z.object({
        channelId: z.string(),
        messageId: z.string(),
        reason: z.string().optional()
    });
  • src/index.ts:386-398 (registration)
    Registration of the discord_delete_message tool in the list of available tools, including name, description, and input schema.
    {
      name: "discord_delete_message",
      description: "Deletes a specific message from a Discord text channel",
      inputSchema: {
        type: "object",
        properties: {
          channelId: { type: "string" },
          messageId: { type: "string" },
          reason: { type: "string" }
        },
        required: ["channelId", "messageId"]
      }
    },
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 states the action ('Deletes') but fails to mention critical details such as required permissions (e.g., 'Manage Messages'), whether the deletion is permanent or reversible, rate limits, or error handling. This leaves significant gaps in understanding the tool's behavior.

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, clear sentence that front-loads the core action and resource without any wasted words. It is appropriately sized for a straightforward tool, making it easy to parse and understand at a glance.

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 destructive operation with 3 parameters), lack of annotations, and no output schema, the description is incomplete. It does not cover behavioral aspects like permissions or effects, parameter details, or return values, leaving the agent with insufficient context for safe and effective use.

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?

The input schema has 0% description coverage, so the description must compensate. It does not explain what 'channelId' or 'messageId' represent (e.g., Discord IDs), the format of these IDs, or the optional 'reason' parameter's purpose (e.g., audit log entry). This lack of semantic detail makes parameter usage ambiguous.

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 ('Deletes') and the resource ('a specific message from a Discord text channel'), making the purpose immediately understandable. However, it does not explicitly differentiate from sibling tools like 'discord_delete_channel' or 'discord_delete_forum_post', which target different resources, so it lacks explicit sibling distinction.

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, such as 'discord_remove_reaction' for reactions or 'discord_delete_channel' for channels. It also omits prerequisites like needing appropriate permissions or being in the correct context, leaving usage unclear beyond the basic action.

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

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